Show menu

MAGIC matrix function


MAGIC(n) creates a n × n matrix with as elements the integers 1 through n2, with equal row and column sums.

The argument n must be larger than 2.

If n=1 then the function returns the scalar {1}; if n=2 then a nonmagic square matrix is returned.



See also

Share on Facebook Share on Twitter

This site uses cookies to store information on your computer. More info...