Office Applications and Entertainment, Magic Squares  
Index  About the Author 
a(21) = s1  a(22)  a(23)  a(24)  a(25) a(16) = s1  a(17)  a(18)  a(19)  a(20) a(15) = 0.6 * s1 + a(17) + a(18) + 0.6 * a(21) + 0.6 * a(22) + 0.6 * a(23) + 0.6 * a(24)  0.4 * a(25) a(14) = 1.4 * s1  a(18)  a(19)  a(20)  0.4 * a(21)  0.4 * a(22)  0.4 * a(23)  1.4 * a(24)  0.4 * a(25) a(13) = 1.4 * s1  a(17)  a(18)  a(19)  0.4 * a(21)  0.4 * a(22)  1.4 * a(23)  0.4 * a(24)  0.4 * a(25) a(12) = 0.6 * s1 + a(19) + a(20) + 0.6 * a(21)  0.4 * a(22) + 0.6 * a(23) + 0.6 * a(24) + 0.6 * a(25) a(11) = 0.6 * s1 + a(18) + a(19)  0.4 * a(21) + 0.6 * a(22) + 0.6 * a(23) + 0.6 * a(24) + 0.6 * a(25) a(10) = s1  a(17)  a(18)  a(22)  a(23) a( 9) = s1 + a(18) + a(19) + a(20) + a(23) + a(24) + a(25) a( 8) = s1 + a(17) + a(18) + a(19) + a(22) + a(23) + a(24) a( 7) = s1  a(19)  a(20)  a(24)  a(25) a( 6) = s1  a(18)  a(19)  a(23)  a(24) a( 5) = 0.6 * s1  a(20)  0.6 * a(21) + 0.4 * a(22) + 0.4 * a(23)  0.6 * a(24)  0.6 * a(25) a( 4) = 0.6 * s1  a(19) + 0.4 * a(21) + 0.4 * a(22)  0.6 * a(23)  0.6 * a(24)  0.6 * a(25) a( 3) = 0.6 * s1  a(18) + 0.4 * a(21)  0.6 * a(22)  0.6 * a(23)  0.6 * a(24) + 0.4 * a(25) a( 2) = 0.6 * s1  a(17)  0.6 * a(21)  0.6 * a(22)  0.6 * a(23) + 0.4 * a(24) + 0.4 * a(25) a( 1) = 1.4 * s1 + a(17) + a(18) + a(19) + a(20) + 0.4 * a(21) + 0.4 * a(22) + 1.4 * a(23) + 1.4 * a(24) + 0.4 * a(25)
which can can be rewritten as:
a(21) = s1  a(22)  a(23)  a(24)  a(25)
The linear equations shown above, are ready to be solved, for the magic constant 65.
0 < a(i) =< 25 for i = 1, 2, ... 16, 21
which can be incorporated in the guessing routine and reduce the number of guesses, and consequently the processor time, dramatically (MgcSqr5a).
3.2.1 Analytic Solution, Simple Magic Squares (1)
If the requirements for Pan Magic Squares, as discussed in section 3.1 above, are moderated till the sum of all rows, columns and main diagonals sum to the same magic constant, the applicable equations are:
a( 1) + a( 2) + a( 3) + a( 4) + a( 5) = s1
Or in matrix representation:
Or shorter:
and reduced, by means of row and column manipulations, to:

a(21) = 65  a(22)  a(23)  a(24)  a(25) a(16) = 65  a(17)  a(18)  a(19)  a(20) a(11) = 65  a(12)  a(13)  a(14)  a(15) a( 9) = a(10)  a(13) + a(15)  a(17) + a(20)  a(21) + a(25) a( 7) = (65  a( 8)  a( 9)  a(10) + a(11)  a(13) + a(16)  a(19) + a(21)  a(25)) / 2 a( 6) = 65  a( 7)  a( 8)  a( 9)  a(10) a( 5) = 65  a( 9)  a(13)  a(17)  a(21) a( 4) = 65  a( 9)  a(14)  a(19)  a(24) a( 3) = 65  a( 8)  a(13)  a(18)  a(23) a( 2) = 65  a( 7)  a(12)  a(17)  a(22) a( 1) = 65  a( 2)  a( 3)  a( 4)  a( 5)
The linear equations shown above, are ready to be solved, for the magic constant 65.
0 < a(i) =< 25 for i = 1, 2 ... 7, 9, 11, 16 and 21
which can be incorporated in the guessing routine (MgcSqr5a2).
3.2.2 Analytic Solution, Simple Magic Squares (2)
Although this result might look satisfactorily,
it is disappointing with regard to the total number of Simple Magic Squares of the 5^{th} order
(8 * 275305224) as determined by Richard Schroeppel in 1973 (ref. Scientific American 1978).
a( 1) = s1  a( 7)  a(13)  a(19)  a(25)
The solutions can be obtained by guessing the 14 parameters:
a(25) < a(19), a(7), a(1), a(21), a(17), a(9), a(5)
can be incorporated (MgcSqr5b2).
With the diagonal a(1)  a(25) constant, subject routine generated 5111 Unique Simple Magic Squares of the 5^{th} order within 17,3 seconds,
of which the first 728 are shown in Attachment 3.4.2.
The same routine counted 68826306 (= 275305224/4) Essential Different Simple Magic Squares in 18,4 hrs, thus confirming the findings of Richard Schroeppel:
Attachment 3.4.3 shows the frequency n5 of subject Essential Different Magic Squares as a function of a(25) and a(19).
Other magic constants are possible for both Magic Squares and Pan Magic Squares.
The last mentioned procedure (CnstrSqrs5b) counted in about 24 hours 10310400
Pan Magic Squares of the 5^{th} order with magic constant 315 for distinct integers from 1 to 125.
3.4 Rotation, Reflection, Row and Column Shifts
Rotation and Reflection (General)
Each Magic Square has 8 orientations which can be reached by means of rotation and/or reflection
(ref. Attachment 5.5.2).
Row and Column Shifts (Pan Magic)
Each Pan Magic Square of order n is part of a collection of n x n Pan Magic Squares which can be obtained by means of row and/or column shifts
(ref. Attachment 5.5.5).
Combined Rotation, Reflection, Row and Column Shifts (Pan Magic)
Consequently each Pan Magic Square of order n is part of a collection {A_{ij}^{k}} containing 8 x n x n Pan Magic Squares (ref. Attachment 5.5.5).
3.5 Transformations and Standard Positions
Each 5^{th} order Simple Magic Square corresponds with 4 transformations as described below:
Note: Secondary properties, e.g. pandiagonal, are not invariant to the transformations described above.
3.5.2 Standard Positions
Standard Position of Unique Magic Squares
Each of the 8 orientations (aspects) can be considered to be the same Unique Magic Square.
a(25) < a(21), a(5), a(1)
Standard position of Essential Different Magic Squares
Two different Unique Magic Squares are called Essential Different, if it is not possible
to transform one square into the other square by means of the transformations described above.
a(25) < a(19), a(7), a(1), a(21), a(17), a(9), a(5)
An example of a square in standard position  with the main diagonals highlighted  is shown in Attachment 5.5.6.

Index  About the Author 