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

panmagic.6npm1

Panmagic squares of order 4n, 6n+1 and 6n-1


Description

Produce a panmagic square of order 4n or 6n+/-1 using a classical method

Usage

panmagic.6npm1(n)
panmagic.6np1(m)
panmagic.6nm1(m)
panmagic.4n(m)

Arguments

m

Function panmagic.6np1(m) returns a panmagic square of order n=6m+1 for m>=1, and function panmagic.6nm1(m) returns a panmagic square of order n=6m-1 for m>=1, using a classical method.

Function panmagic.4n(m) returns a magic square of order n=4m

n

Function panmagic.6npm1(n) returns a panmagic square of order n where n=6n+/-1

Details

Function panmagic.6npm1(n) will return a square if n is not of the form 6n+/-1, but it is not necessarily magic.

Author(s)

Robin K. S. Hankin

References

“Pandiagonal magic square.” Wikipedia, The Free Encyclopedia. Wikimedia Foundation, Inc. 13 February 2013

See Also

Examples

panmagic.6np1(1)
panmagic.6npm1(13)

all(sapply(panmagic.6np1(1:3),is.panmagic))

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.