Office Applications and Entertainment, Magic Squares

Vorige Pagina Volgende Pagina Index About the Author

6.4a Further Analysis, Symmetrical Main Diagonals (1)

For a magic square with symmetrical main diagoanls, following equations should be added to the equations describing a simple magic square of order 6 (Section 6.2).

   a(1) + a(36) = a(8 ) + a(29) = a(15) + a(22) = s1/3

   a(6) + a(31) = a(11) + a(26) = a(16) + a(21) = s1/3

which results, after deduction, in following linear equations:

a(31) = s1 - a(32) - a(33) - a(34) - a(35) - a(36)
a(25) = s1 - a(26) - a(27) - a(28) - a(29) - a(30)
a(19) = s1 - a(20) - a(21) - a(22) - a(23) - a(24)
a(16) = {s1 - 3 * a(21)}/3
a(15) = {s1 - 3 * a(22)}/3
a(13) = {s1 - 3 * a(14) - 3 * a(17) - 3 * a(18) + 3 * a(21) + 3 * a(22)}/3
a(12) = {2 * s1 - 3 * a(18) - 3 * a(24) - 3 * a(30) + 3 * a(31) - 3 * a(36)}/3
a(11) = {s1 - 3 * a(26)}/3
a( 9) = {4 * s1 - 3 * a(10) - 3 * a(14) - 3 * a(17) - 3 * a(20) - 3 * a(23) - 3 * a(27) - 3 * a(28)}/3
a( 8) = {s1 - 3 * a(29)}/3
a( 7) = {s1 + 3 * a(14) + 3*a(17) + 3*a(18) - 3*a(19) - 3*a(21) - 3 * a(22) - 3 * a(25) - 3 * a(31) + 3 * a(36)}/3
a( 6) = {s1 - 3 * a(31)}/3
a( 5) = {2 * s1 - 3 * a(17) - 3 * a(23) + 3 * a(26) - 3 * a(29) - 3 * a(35)}/3
a( 4) = {2 * s1 - 3 * a(10) + 3 * a(21) - 3 * a(22) - 3 * a(28) - 3 * a(34)}/3
a( 3) = {s1 + 3 * a(10) + 3 * a(14) + 3 * a(17) - 3 * a(19) - 6 * a(21) - 3 * a(24) + 3 * a(28) - 3 * a(33)}/3
a( 2) = {2 * s1 - 3 * a(14) - 3 * a(20) - 3 * a(26) + 3 * a(29) - 3 * a(32)}/3
a( 1) = {s1 - 3 * a(36)}/3

The number of magic squares - with symmetrical diagonals - is still very huge because the squares are determined by 19 independent variables (red).

6 32 3 34 35 1
7 11 27 28 8 30
19 14 16 15 23 24
18 20 22 21 17 13
25 29 10 9 26 12
36 5 33 4 2 31

With the highlighted variables constant, an optimized guessing routine (MgcSqr6c), produced 416 magic squares within 32 minutes, which are shown in Attachment 6.6.2.

This is about half the number of squares found in section 6.2 under less restrictive conditions (ref. Attachment 6.5.1).

As described in next section, magic squares with symmetrical diagonals will allow for another Class definition.

6.4b Further Analysis, Symmetrical Main Diagonals (2)

A very fast routine - in which after the bottom row, first the main diagonals and afterward the remaining rows and columns are calculated - can be developed.

This sequence together with the properties of a Magic Square with Symmetrical Main Diagonals result, after deduction, in following set of linear equations:

a(31) = s1   - a(32) - a(33) - a(34) - a(35) - a(36)
a( 5) = s1   - a(11) - a(17) - a(23) - a(29) - a(35)
a( 2) = s1   - a( 8) - a(14) - a(20) - a(26) - a(32)
a( 4) = s1   - a( 1) - a( 2) - a( 3) - a( 5) - a( 6)
a(10) = s1   - a( 4) - a(16) - a(22) - a(28) - a(34)
a( 9) = s1   - a( 3) - a(15) - a(21) - a(27) - a(33)
a(19) = s1   - a(20) - a(21) - a(22) - a(23) - a(24)
a(13) = s1   - a(14) - a(15) - a(16) - a(17) - a(18)
a( 7) = s1   - a( 8) - a( 9) - a(10) - a(11) - a(12)
a(25) = s1   - a( 1) - a( 7) - a(13) - a(19) - a(31)
a(30) = s1   - a(12) - a(18) - a(24) - a( 6) - a(36)

a( 1) = s1/3 - a(36)
a( 6) = s1/3 - a(31)
a( 8) = s1/3 - a(29)

a(15) = s1/3  - a(22)
a(11) = s1/3  - a(26)
a(16) = s1/3  - a(21)

The solutions can be obtained by guessing the 19 parameters:

   a(i) for i = 3, 12, 14, 17, 18, 20 ... 24, 26 ... 29, 32 ... 36

and filling out these guesses in the abovementioned equations.

The linear equations shown above can be incorporated in a guessing routine, in which the relations ensuring Unique Essential Different Magic Squares:

a(36) is the smallest of all integers in the two main diagonals
a(29) < a(8),  a(22) < a(15), a(29) < a(22)
a(31) < a(6)

can be incorporated (MgcSqr6c2).

Subject routine generated within the same 32 minutes 339847 Essential Different Magic Squares with Symmetrical Diagonals, of which the first 416 are shown in Attachment 6.6.3.

6.5a Class Definition, Symmetrical Main Diagonals

For a magic square with symmetrical main diagonals:

6 32 3 34 35 1
7 11 27 28 8 30
19 14 16 15 23 24
18 20 22 21 17 13
25 29 10 9 26 12
36 5 33 4 2 31

with:

   a(1) + a(36) = a(8 ) + a(29) = a(15) + a(22) = s1/3

   a(6) + a(31) = a(11) + a(26) = a(16) + a(21) = s1/3

we can define following operations, which will result also in a magic square with symmetrical main diagonals.

Swap row 1 and 6, Swap row 2 and 5, Swap row 3 and 4 or a combination of these operations.

Swap column 1 and 6, Swap column 2 and 5, Swap column 3 and 4 or a combination of these operations.

Any combination of above mentioned row and column operations will also result in a magic square with symmetrical main diagonals.

This can be formalised to a set of operators:

  Rij(A) with (i = 0, 1, ... 7; j = 0, 1, ... 7)

for which the definitions are summarised in following table:

Swap none 1;6 2;5 3;4 1;6 and 2;5 1;6 and 3;4 2;5 and 3;4 1;6, 2;5 and 3;4
Row i = 0 i = 1 i = 2 i = 3 i = 4 i = 5 i = 6 i = 7
Column j = 0 j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7

If above defined operators are applied on the magic square A1 at the top of this page, a collection of 64 squares will result.

It should be noted that the squares which can be obtained by means of horizontal reflection (A1* Is), vertical reflection (Is* A1) and 180o rotation (Is* A1* Is) are included in this collection (ref. Attachment 6.7.1).

If above defined operators are applied on the transposed A1T of the magic square A1 at the top of this page, another collection of 64 squares will result.

It should be noted that the squares which can be obtained by means of 90o rotation (A1T* I1), 270o rotation(Is* A1T) and vertical reflection on 90o rotation (Is* A1T* Is) are included in this collection (ref. Attachment 6.7.1).

As a consequence of the fact that all magic squares, which can be obtained by means of rotation and/or reflection, were found as a result of applying the operator Rij(A) on A1 and A1T, we can conclude that, when we write A1T as A2, any magic square with symmetrical diagonals, will result in a sub collection or Class {Aijk} with:

  Aijk = Rij(Ak) for (i = 0, 1, ... 7; j = 0, 1, ... 7 and k = 1, 2)

with:

  A00k = R00(Ak) = Ak for (k = 1, 2)

Attachment 6.7.1 shows the 128 magic squares constructed based on the above, applied on the Base Square A1.

6.5b Transformations, Symmetrical Main Diagonals

For magic squares, related squares can be found by means of rotation and/or reflection (ref. Attachment 6.5.2).

Further each 6th order magic square with symmetrical main diagonals corresponds with 96 transformations as described below:

  • Any row n can be interchanged with row (7 - n), any column n can be interchanged with column (7 - n),
    resulting in 16 transformations, which are shown in Attachment 6.5.7.

  • Any permutation can be applied to the lines 1, 2, 3 provided that the same permutation is applied to the lines 6, 5, 4. The possible number of transformations is 3! = 6, which are shown in Attachment 6.5.4.

  • The resulting number of transformations, is 16 * 6 = 96, which are shown in Attachment 6.5.8

Based on this set of transformations and the eight aspects shown in Attachment 6.5.2, any 6th order magic square with symmetrical diagonals corresponds with a Class of 8 * 96 = 768 squares (ref. Attachment 6.5.9).

Note:
The same result will be obtained when the permutations shown in Attachment 6.5.4 are applied on the Sub Class shown in Attachment 6.7.1, resulting in 6 * 128 = 768 magic squares with symmetrical diagonals.


Vorige Pagina Volgende Pagina Index About the Author