lozenge: Conway's lozenge algorithm for magic squares

lozengeR Documentation

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

magic.4np2

Examples

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

magic documentation built on Nov. 16, 2022, 9:06 a.m.