Antimagic Square

Author

Eric W. Weisstein
November 3, 2002

This notebook downloaded from http://mathworld.wolfram.com/notebooks/RecreationalMath/AntimagicSquare.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/AntimagicSquare.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<MagicSquares`;

Examples

a[4]={{15,2,12,4},
		{1,14,10,5},
		{8,9,3,16},
		{11,13,6,7}};
a[5]={{21,18,6,17,4},
		{7,3,13,16,24},
		{5,20,23,11,1},
		{15,8,19,2,25},
		{14,12,9,22,10}};
a[6]={{10,25,32,13,16,9},
		{22,7,3,24,21,30},
		{20,27,18,26,11,6},
		{1,31,23,33,17,8},
		{19,5,36,12,15,29},
		{34,14,2,4,35,28}};
a[7]={{14,3,34,21,47,29,22},
		{43,16,13,25,6,26,44},
		{30,48,24,8,12,9,45},
		{10,5,11,38,49,46,19},
		{4,41,37,36,33,27,1},
		{39,17,40,20,7,35,23},
		{31,42,18,32,28,2,15}};
a[8]={{49,16,50,10,19,28,24,56},
		{42,43,11,15,44,38,55,5},
		{25,21,48,46,9,37,6,63},
		{29,47,8,40,51,30,52,1},
		{45,22,54,23,20,34,2,62},
		{14,59,18,33,41,26,61,13},
		{36,12,58,32,27,64,3,35},
		{17,39,7,57,53,4,60,31}};
a[9]={{52,19,81,22,29,15,42,31,76},
		{61,10,67,23,54,79,25,33,16},
		{57,9,71,24,38,1,51,47,75},
		{26,78,7,69,66,77,13,27,12},
		{39,21,74,20,37,17,49,55,64},
		{8,65,4,62,50,34,73,41,40},
		{56,68,2,63,14,72,35,44,6},
		{53,30,60,32,36,3,46,43,58},
		{11,70,5,59,48,80,28,45,18}};

AntimagicQ/@Array[a,6,4]

Sort/@HeterosquareSums/@{a[4],a[5],a[6]}

Show[GraphicsArray[Partition[AntimagicSquarePlot[#,DisplayFunction->Identity]&/@Array[a,6,4],
3,3,{1,1},{}]]]