MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Magic Matrices


Hi All,

does anyone know of code for Mathematica to produce magic matrices?

For example Magic[n] would produce an nxn matrix where all of the 
row, column and diagonal sums are equal.

As an example:

Magic[3] would produce as output:

{{8,1,6},{3,5,7},{4,9,2}}.


Thank you for any inputs, Flip


-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG


  • Prev by Date: Intersection Ellipse & Circle
  • Next by Date: Difference between Get[] and Copy-Past operation
  • Previous by thread: Re: Intersection Ellipse & Circle
  • Next by thread: Re: Magic Matrices