| hudson {magic} | R Documentation |
Pandiagonal magic squares due to Hudson
Description
Returns a regular pandiagonal magic square of order
6m\pm 1 using a method developed by Hudson.
Usage
hudson(n = NULL, a = NULL, b = NULL)
Arguments
n |
Order of the square, |
a |
The first line of Hudson's |
b |
The first line of Hudson's |
Details
Returns one member of a set of regular magic squares of order
n=6m\pm 1. The set is of size (n!)^2.
Note that n is not checked for being in the form 6n\pm
1. If it is not the correct form, the square is magic
but not necessarily normal.
Author(s)
Robin K. S. Hankin
References
C. B. Hudson, On pandiagonal squares of order 6t +/- 1, Mathematics Magazine, March 1972, pp94-96
See Also
Examples
hudson(n=11)
magicplot(hudson(n=11))
is.associative(hudson(n=13))
hudson(a=(2*1:13)%%13 , b=(8*1:13)%%13)
all(replicate(10,is.magic(hudson(a=sample(13),b=sample(13)))))
[Package magic version 1.6-1 Index]