Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lozenge

Conway's lozenge algorithm for magic squares


Description

Uses John Conway's lozenge algorithm to produce magic squares of odd order.

Usage

lozenge(m)

Arguments

m

magic square returned is of order n=2m+1

Author(s)

Robin Hankin

See Also

Examples

lozenge(4)
all(sapply(1:10,function(n){is.magic(lozenge(n))}))

magic

Create and Investigate Magic Squares

v1.5-9
GPL-2
Authors
Robin K. S. Hankin
Initial release
2018-09-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.