A Magic Square for which all rows, columns and all diagonals sum to the same constant is normally referred to as a Pan Magic Square.
Magic squares of order 8 can be represented as follows:
a(1)
|
a(2)
|
a(3)
|
a(4)
|
a(5)
|
a(6)
|
a(7)
|
a(8)
|
a(9)
|
a(10)
|
a(11)
|
a(12)
|
a(13)
|
a(14)
|
a(15)
|
a(16)
|
a(17)
|
a(18)
|
a(19)
|
a(20)
|
a(21)
|
a(22)
|
a(23)
|
a(24)
|
a(25)
|
a(26)
|
a(27)
|
a(28)
|
a(29)
|
a(30)
|
a(31)
|
a(32)
|
a(33)
|
a(34)
|
a(35)
|
a(36)
|
a(37)
|
a(38)
|
a(39)
|
a(40)
|
a(41)
|
a(42)
|
a(43)
|
a(44)
|
a(45)
|
a(46)
|
a(47)
|
a(48)
|
a(49)
|
a(50)
|
a(51)
|
a(52)
|
a(53)
|
a(54)
|
a(55)
|
a(56)
|
a(57)
|
a(58)
|
a(59)
|
a(60)
|
a(61)
|
a(62)
|
a(63)
|
a(64)
|
As the numbers a(i), i = 1 ... 64, in all rows, columns and diagonals sum to the same constant this results for Pan Magic Squares in following linear
equations:
a( 1) + a( 2) + a( 3) + a( 4) + a( 5) + a( 6) + a( 7) + a( 8) = s1
a( 9) + a(10) + a(11) + a(12) + a(13) + a(14) + a(15) + a(16) = s1
a(17) + a(18) + a(19) + a(20) + a(21) + a(22) + a(23) + a(24) = s1
a(25) + a(26) + a(27) + a(28) + a(29) + a(30) + a(31) + a(32) = s1
a(33) + a(34) + a(35) + a(36) + a(37) + a(38) + a(39) + a(40) = s1
a(41) + a(42) + a(43) + a(44) + a(45) + a(46) + a(47) + a(48) = s1
a(49) + a(50) + a(51) + a(52) + a(53) + a(54) + a(55) + a(56) = s1
a(57) + a(58) + a(59) + a(60) + a(61) + a(62) + a(63) + a(64) = s1
a( 1) + a( 9) + a(17) + a(25) + a(33) + a(41) + a(49) + a(57) = s1
a( 2) + a(10) + a(18) + a(26) + a(34) + a(42) + a(50) + a(58) = s1
a( 3) + a(11) + a(19) + a(27) + a(35) + a(43) + a(51) + a(59) = s1
a( 4) + a(12) + a(20) + a(28) + a(36) + a(44) + a(52) + a(60) = s1
a( 5) + a(13) + a(21) + a(29) + a(37) + a(45) + a(53) + a(61) = s1
a( 6) + a(14) + a(22) + a(30) + a(38) + a(46) + a(54) + a(62) = s1
a( 7) + a(15) + a(23) + a(31) + a(39) + a(47) + a(55) + a(63) = s1
a( 8) + a(16) + a(24) + a(32) + a(40) + a(48) + a(56) + a(64) = s1
a( 1) + a(10) + a(19) + a(28) + a(37) + a(46) + a(55) + a(64) = s1
a( 2) + a(11) + a(20) + a(29) + a(38) + a(47) + a(56) + a(57) = s1
a( 3) + a(12) + a(21) + a(30) + a(39) + a(48) + a(49) + a(58) = s1
a( 4) + a(13) + a(22) + a(31) + a(40) + a(41) + a(50) + a(59) = s1
a( 5) + a(14) + a(23) + a(32) + a(33) + a(42) + a(51) + a(60) = s1
a( 6) + a(15) + a(24) + a(25) + a(34) + a(43) + a(52) + a(61) = s1
a( 7) + a(16) + a(17) + a(26) + a(35) + a(44) + a(53) + a(62) = s1
a( 8) + a( 9) + a(18) + a(27) + a(36) + a(45) + a(54) + a(63) = s1
a( 8) + a(15) + a(22) + a(29) + a(36) + a(43) + a(50) + a(57) = s1
a( 7) + a(14) + a(21) + a(28) + a(35) + a(42) + a(49) + a(64) = s1
a( 6) + a(13) + a(20) + a(27) + a(34) + a(41) + a(56) + a(63) = s1
a( 5) + a(12) + a(19) + a(26) + a(33) + a(48) + a(55) + a(62) = s1
a( 4) + a(11) + a(18) + a(25) + a(40) + a(47) + a(54) + a(61) = s1
a( 3) + a(10) + a(17) + a(32) + a(39) + a(46) + a(53) + a(60) = s1
a( 2) + a( 9) + a(24) + a(31) + a(38) + a(45) + a(52) + a(59) = s1
a( 1) + a(16) + a(23) + a(30) + a(37) + a(44) + a(51) + a(58) = s1
Or in matrix representation:
→ →
A * a = s1
which can be reduced, by means of row and column manipulations,
and results in following linear equations:
a(57) = s1 - a(58) - a(59) - a(60) - a(61) - a(62) - a(63) - a(64)
a(49) = s1 - a(50) - a(51) - a(52) - a(53) - a(54) - a(55) - a(56)
a(41) = s1 - a(42) - a(43) - a(44) - a(45) - a(46) - a(47) - a(48)
a(33) = s1 - a(34) - a(35) - a(36) - a(37) - a(38) - a(39) - a(40)
a(25) = s1 - a(26) - a(27) - a(28) - a(29) - a(30) - a(31) - a(32)
a(23) = 3 * s1 - a(24) - a(25) - a(30) - 2 * a(31) - 2 * a(32) - a(33) + a(35) + a(36) - a(38) - 2 * a(39) +
- 2 * a(40) - a(41) + a(43) + a(44) - a(46) - 2 * a(47) - 2 * a(48) - a(49) - a(54) - 2 * a(55) +
- 2 * a(56) - a(63) - a(64)
a(22) = 2 * s1 + a(24) + a(25) - a(29) - a(30) + a(32) - a(35) - 2 * a(36) - 2 * a(37) - 2 * a(38) - a(39) +
- a(43) - 2 * a(44) - 2 * a(45) - 2 * a(46) - a(47) + a(49) - a(53) - a(54) + a(56) - a(62) + a(64)
a(21) = s1 - a(24) + a(26) + a(27) - a(37) - a(38) - a(39) - a(40) - a(45) - a(46) - a(47) - a(48) +
+ a(50) + a(51) - a(61) - a(64)
a(20) = a(21) - a(23) + a(24) + a(25) - a(27) - a(36) + a(40) - a(44) + a(48) + a(49) - a(51) +
- a(60) + a(61) - a(63) + a(64)
a(19) = s1 - a(24) + a(29) + a(30) - a(33) - a(34) - a(35) - a(40) - a(41) - a(42) - a(43) - a(48) +
+ a(53) + a(54) - a(59) - a(64)
a(18) = s1 - a(21) + a(31) + a(32) - a(34) - a(35) - a(36) - a(37) - a(42) - a(43) - a(44) - a(45) +
+ a(55) + a(56) - a(58) - a(61)
a(17) = s1 - a(18) - a(19) - a(20) - a(21) - a(22) - a(23) - a(24)
a(16) = - s1/2 - a(23) - a(24) - a(30) - a(31) - a(32) + a(33) + a(34) + a(35) + a(36) + a(41) + a(42) +
+ a(43) + a(49) + a(50) + a(57)
a(15) = a(16) - a(22) + a(24) - a(29) + a(32) - a(36) + a(40) - a(43) + a(48) - a(50) + a(56) +
- a(57) + a(64)
a(14) = a(16) + a(17) - a(21) + a(26) - a(28) - a(42) + a(44) - a(49) + a(53) + a(62) - a(64)
a(13) = a(15) - a(20) + a(24) + a(25) - a(27) - a(41) + a(43) + a(52) - a(56) + a(61) - a(63)
a(12) = a(14) - a(19) + a(23) - a(26) + a(32) + a(42) - a(48) + a(51) - a(55) + a(60) - a(62)
a(11) = a(13) - a(18) + a(22) - a(25) + a(31) + a(41) - a(47) + a(50) - a(54) + a(59) - a(61)
a(10) = a(12) - a(17) + a(21) + a(30) - a(32) - a(46) + a(48) + a(49) - a(53) + a(58) - a(60)
a( 9) = s1 - a(10) - a(11) - a(12) - a(13) - a(14) - a(15) - a(16)
a( 8) = s1 - a(16) - a(24) - a(32) - a(40) - a(48) - a(56) - a(64)
a( 7) = s1 - a(15) - a(23) - a(31) - a(39) - a(47) - a(55) - a(63)
a( 6) = s1 - a(14) - a(22) - a(30) - a(38) - a(46) - a(54) - a(62)
a( 5) = s1 - a(13) - a(21) - a(29) - a(37) - a(45) - a(53) - a(61)
a( 4) = s1 - a(12) - a(20) - a(28) - a(36) - a(44) - a(52) - a(60)
a( 3) = s1 - a(11) - a(19) - a(27) - a(35) - a(43) - a(51) - a(59)
a( 2) = s1 - a(10) - a(18) - a(26) - a(34) - a(42) - a(50) - a(58)
a( 1) = s1 - a( 2) - a( 3) - a( 4) - a( 5) - a( 6) - a( 7) - a( 8)
However the solutions can only be obtained by guessing a(24), a(26) ... a(32), a(34) ... a(40), a(42) ... a(48),
a(50) ... a(56) and a(58) ... a(64) and filling out these guesses in the abovementioned equations.
For distinct integers also following inequalities should be applied:
0 < a(i) =< 64 for i = 1, 2, ... 23, 25, 33, 41, 49, 57
a(i) ≠ a(j) for i ≠ j
which can be incorporated in a guessing routine, which might be used to generate - if not all - at least collections of 8th order squares with distinct integers within a reasonable time.
Any 8th order Pan Magic Square, is part of a collection {Aijk} of 512 elements obtained by means of rotation, reflection, column and/or row shifts (ref. Attachment 8.1.3 ).
8.1.2 Further Analysis, Matrix Operation
Rather than trying to find solutions based on the equations deducted in section 8.1.1 above, the construction method described in section 13.4 will be used as a starting point for the generation of 8th order Pan Magic Squares.
As illustrated in section 13.4 an individual Pan Magic Square of order 8 can be constructed by means of following method:
-
Fill the first 4 columns of the first row of square A with 4 different natural numbers 1 =< n =< 8;
-
Fill the first 4 columns of the second row with 4 other different natural numbers 1 =< n =< 8, such that each vertical pair will have the same sum;
-
Copy the resulting 2 × 4 rectangle 3 times under the first rectangle;
-
Copy the resulting left 8 × 4 rectangle into the right 8 × 4 rectangle but shift it ring-wise by one row;
-
Construct a second square R by means of 90o rotation of square A;
-
Construct square B by means of the matrix operation
B = 8 * R + A - 8.
Which can be realized by means of an Excel spreadsheet as shown below:
|