Office Applications and Entertainment, Magic Squares  Index About the Author

14.0   Special Magic Squares, Prime Numbers

14.5   Magic Squares (7 x 7)

Comparable routines as discussed in previous sections can be written to generate Prime Number Magic Squares of order 7, however such routines are not very feasible due to the high number of independent variables, e.g. 24 ea for Pan Magic Squares and 12 ea for Ultra Magic Squares.

In next sections solutions will be found for some more strict defined Prime Number Magic Squares of the 7th order.

14.5.1 Concentric Magic Squares (7 x 7)

A 7th order Prime Number Concentric Magic Square consists of a Prime Number Concentric Magic Square of the 5th order, as discussed in Section 14.3.2, with a border around it.

The variable values {ai} on which a Prime Number Concentric Magic Square of the 7th order might be based should contain at least 24 pairs.

Based on the possible pairs for a certain amount of Prime Numbers, the corresponding Magic Sums of the outer - and embedded squares (MC7 and MC5) can be determined.

Based on the equations defining the border of a Concentric Magic Square (7 x 7):

```a(43) =      s1   - a(44) - a(45) - a(46) - a(47) - a(48) - a(49)
a(36) =  2 * s1/7 - a(42)
a(29) =  2 * s1/7 - a(35)
a(22) =  2 * s1/7 - a(28)
a(15) =  2 * s1/7 - a(21)
a(14) = -3 * s1/7 + a(15) + a(22) + a(29) + a(36) + a(43) - a(49)
a( 8) =  2 * s1/7 - a(14)
a( 7) =  2 * s1/7 - a(43)
a( 6) =  2 * s1/7 - a(48)
a( 5) =  2 * s1/7 - a(47)
a( 4) =  2 * s1/7 - a(46)
a( 3) =  2 * s1/7 - a(45)
a( 2) =  2 * s1/7 - a(44)
a( 1) =  2 * s1/7 - a(49)
```

a routine can be written to generate Prime Number Concentric Magic Squares of order 7 (ref. Priem7a1).

Attachment 14.6.1 shows one Prime Number Concentric Magic Square for some of the occurring Magic Sums.

It should be noted that:

• the routine Priem7a1 searched only those solutions per Magic Sum which could be found within 10 seconds and

• although not usual, one (1) has not been excluded from the collection of defining prime numbers.

Each square shown corresponds with numerous squares for the same Magic Sum, depending from the selected variable values {ai} and the related number of possible Embedded Magic Squares.

Note:

For Prime Number Concentric Magic Squares of order 7 with Magic Sum s7, it is convenient to split the supplementary rows and columns into parts summing to s4 = 4 * s7 / 7 and s3 = 3 * s7 / 7:

 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)

This results in following alternative border equations:

 a( 4) = s4 - a( 5) - a( 6) - a(7) a(28) = s4 - a(21) - a(14) - a(7) a(43) = s4/2 - a( 7) a(46) = s4/2 - a( 4) a(47) = s4/2 - a( 5) a(48) = s4/2 - a( 6) a( 8) = s4/2 - a(14) a(15) = s4/2 - a(21) a(22) = s4/2 - a(28) a( 1) = s3 - a( 2) - a( 3) a(35) = s3 - a(42) - a(49) a(44) = s4/2 - a( 2) a(45) = s4/2 - a( 3) a(49) = s4/2 - a( 1) a(36) = s4/2 - a(42) a(29) = s4/2 - a(35)

which enable the development of a much faster routine to generate Prime Number Concentric Magic Squares of order 7 (ref. Priem7a2).

Subject routine produced, based on 1689 previously generated Concentric Magic Squares of order 5, 1689 Prime Number Concentric Magic Square of order 7 within 272 seconds (one square per Magic Sum).

14.5.2 Bordered Magic Squares (7 x 7)
Miscellaneous Inlays

Based on the collections of 5th order Ultra Magic and Inlaid Magic Squares, as deducted in Section 14.3.5 thru 14.3.9, also following Bordered Magic Squares can be generated with routine Priem7a1:

Each square shown corresponds with numerous squares for the same Magic Sum, depending from the selected variable values {ai} and the related number of possible Center Squares.

14.5.3 Eccentric Magic Squares (7 x 7)

Based on the equations defining the supplementary rows and columns of an Eccentric Magic Square (7 x 7):

```a(43) =  2 * s1/7 - a(44)
a(36) =  2 * s1/7 - a(37)
a(29) =  2 * s1/7 - a(30)
a(22) =  2 * s1/7 - a(23)
a(15) =  2 * s1/7 - a(16)
a(13) =  5 * s1/7 + a(14) - a(19) - a(25) - a(31) - a(37) - a(43)
a( 8) = -5 * s1/7 + a( 9) + a(16) + a(23) + a(30) + a(37) + a(44)
a( 9) =  6 * s1/7 - 0.5 * (a(10) + a(11) + a(12) + a(13) + a(14) + a(16) + a(23) + a(30) + a(37) + a(44))
a( 7) =  2 * s1/7 - a(14)
a( 6) =  2 * s1/7 - a(13)
a( 5) =  2 * s1/7 - a(12)
a( 4) =  2 * s1/7 - a(11)
a( 3) =  2 * s1/7 - a(10)
a( 2) =  2 * s1/7 - a( 8)
a( 1) =  2 * s1/7 - a( 9)
```

a routine can be written to generate Prime Number Eccentric Magic Squares of order 7 (ref. Priem7b).

Attachment 14.6.7 shows one Prime Number Eccentric Magic Square for some of the occurring Magic Sums.

Each square shown corresponds with numerous squares for the same Magic Sum, depending from the selected variable values {ai} and the related number of possible Magic Corner Squares.

Note:

Although the results obtained above are satisfactorily, a much faster routine can be developed based on following principles:

• to read the previously generated Magic Corner Squares of order 5;
• to determine, by means of transformation of an order 3 Magic Square, the top left Corner Pairs (4 ea);
• to complete the Main Diagonal and determine the related Border Pairs (4 ea);
• to complete the Eccentric Magic Square of order 7 with the remainder of the Border Pairs (4 ea).

These principles have been applied successfully in Section 14.8.5, Composed Magic Squares of order 13, for the completion of one of the Embedded Eccentric Magic Squares of order 7 (ref. PriemI7).

14.5.4 Eccentric Magic Squares, Overlapping Sub Squares

Prime Number Eccentric Magic Squares of order 7 with a Magic Sum s1 might contain:

• One 5th order Magic Corner Square with Magic Sum s5 = 5 * s1 / 7 (bottom/right)
• One 3th order Semi Magic Corner Square with Magic Sum s3 = 3 * s1 / 7 (top/left)

as shown below.

 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 dedicated procedure (Priem7e) can be used:

• to read a square from a collection of previously generated 5th order Ultra Magic Squares (ref. Attachment 14.3.6);
• to transform the Ultra Magic Square to a suitable Corner Square;
• to calculate the 3th order Semi Magic Corner Square and
• to complete the 7 x 7 Eccentric Magic Square.

Attachment 14.6.10 shows for miscellaneous Magic Sums the first occurring order 7 Prime Number Eccentric Magic Square with Overlapping Sub Squares.

14.5.5 Associated Magic Squares, Overlapping Sub Squares

Prime Number Magic Squares of order 7 with a Magic Sum s1 can also be composed out of:

• Two each 4th order Magic Corner Squares A and D (s4 = 4 * s1 / 7), with the center element in common, and
• Two each 3th order Semi Magic Corner Squares B and C (s3 = 3 * s1 / 7).

as shown below.

 a1 a2 a3 a4 b1 b2 b3 a5 a6 a7 a8 b4 b5 b6 a9 a10 a11 a12 b7 b8 b9 a13 a14 a15 a16/d1 d2 d3 d4 c1 c2 c3 d5 d6 d7 d8 c4 c5 c6 d9 d10 d11 d12 c7 c8 c9 d13 d14 d15 d16

Associated Magic Squares of order 7 can be constructed based on:

• One Complementary Pair of order 4 Magic Anti Symmetric Corner Squares and
• One Complementary Pair of order 3 Semi Magic Anti Symmetric Corner Squares (7 Magic Lines).

A (Semi) Magic Anti Symmetric Square of order n is a (Semi) Magic Square for which ai + aj ≠ 2 * sn / n for any i and j (i,j = 1 ... n2; i ≠ j).

Anti Symmetric Magic Squares of order 4 can be generated, based on the equations deducted in Section 14.2.1, with the slightly addapted guessing routine Priem4g.

Attachment 14.6.9a shows for miscellaneous Magic Sums the first occurring 4th order Anti Symmetric Magic Square.

A dedicated procedure (Priem3g) can be used:

• to read the Anti Symmetric Magic Square A;
• to calculate the Complementary Magic Square D;
• to generate the Complementary Semi Magic Squares B and C and
• to construct the 7 x 7 Associated Magic Square.

Attachment 14.6.9b shows for miscellaneous Magic Sums the first occurring order 7 Prime Number Associated Magic Square with Overlapping Sub Squares.

14.5.6 Associated Magic Squares, Diamond Inlays Order 3 and 4

Based on the equations defining Associated Magic Squares (Diamond Inlays) of the seventh order:

```a(46) =   4 * s1/7 - a(40) - a(34) - a(28)
a(45) =       s1/7 + a(47) - 2 * a(27) + a(26) - a(20) + a(46) + a(40) - a(28)
a(43) =       s1   - a(44) - a(45) - a(47) - a(48) - a(49) - a(46)
a(39) =   3 * s1/7 - a(33) - a(27)
a(38) =              a(20) - a(46) + a(28)
a(37) = - 3 * s1/7 + a(41) - a(44) + a(48) + a(27) + a(20) + a(34)
a(36) =       s1   - 2 * a(41) - a(42) + a(44) - a(48) + a(33) - 2 * a(20) + a(46) - a(40) - a(34) - a(28)
a(35) = (17 * s1/7 - 2 * a(41) - 2*a(42) - 2*a(47) - 2 * a(48) - 2 * a(49) - a(33) + 2 * a(20) - 2 * a(46) +
- 2 * a(40) - 2 * a(34)) / 2
a(32) =   4 * s1/7 - a(26) - 2 * a(20) + a(46) - a(28)
a(29) =   3 * s1/7 - a(35) - 2 * a(33) - 2 * a(27) + a(26) + 3 * a(20) - a(46) - a(34) + a(28)
a(26) =   4 * s1/7 - a(20) -     a(34) -     a(28)
a(25) =       s1/7
a(19) =   4 * s1/7 - a(33) - 2 * a(27)
```
 a(31) = 2*s1/7 - a(19) a(30) = 2*s1/7 - a(20) a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Associated Magic Squares of order 7 (ref. Priem7e1).

Attachment 14.6.12 shows for miscellaneous Magic Sums the first occurring Prime Number Associated Magic Square.

Each square shown corresponds with numerous squares for the applicable Magic Sum and variable values {ai}.

14.5.7 Associated Magic Squares, Square Inlays Order 3 and 4

Based on the equations defining Associated Magic Squares (Square Inlays) of the seventh order:

```a(44) =     s1   - a(46) - a(48) - a(43) - a(45) - a(47) - a(49)
a(43) = 4 * s1/7 - a(45) - a(47) - a(49)
a(37) = 3 * s1/7 - a(39) - a(41)
a(36) = 4 * s1/7 - a(38) - a(40) - a(42)
a(33) = 2 * s1/7 - a(35) + 0.5 * a(43) + 0.5 * a(45) - 0.5 * a(47) - 0.5 * a(49)
a(32) = 6 * s1/7 - 2 * a(34) - a(46) - 2 * a(48)
a(31) =            a(33) - a(45) + a(47)
a(30) = 3 * s1/7 - a(32) - a(34)
a(29) = 4 * s1/7 - 2 * a(33) - a(35) + a(45) - a(47)
a(28) = 5 * s1/7 - a(38) - a(40) - 2 * a(42)
a(27) = 4 * s1/7 - a(39) - 2 * a(41)
a(26) =     s1/7 + a(38) - a(40)
a(25) =     s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Associated Magic Squares of order 7 (ref. Priem7e2).

Attachment 14.6.13 shows for miscellaneous Magic Sums the first occurring Prime Number Associated Magic Square.

Each square shown corresponds with numerous squares for the applicable Magic Sum and variable values {ai}.

Note:

The order 7 Associated Magic Squares as described above can also be obtained by means of a transformation of order 7 Composed Magic Squares as illustrated below:

MC6 = 10409
 2963 17 1481 2927 1097 311 1613 5 1487 2969 173 701 2273 2801 1493 2957 11 1361 2663 1877 47 1451 317 2693 911 887 1373 2777 2213 1277 971 1997 2153 1667 131 2003 1697 761 2843 1307 821 977 281 2657 1523 197 1601 2087 2063
= > MC6 = 10409
 911 1451 887 317 1373 2693 2777 2927 2963 1097 17 311 1481 1613 1997 2213 2153 1277 1667 971 131 173 5 701 1487 2273 2969 2801 2843 2003 1307 1697 821 761 977 1361 1493 2663 2957 1877 11 47 197 281 1601 2657 2087 1523 2063

The Magic Square shown at the left side above is composed out of:

• One 3th order Simple Magic Corner Square with Magic Sum s3 = 3 * s1 / 7 (top/left)
• One 4th order Associated Magic Corner Square with Magic Sum s4 = 4 * s1 / 7 (bottom/right)
• Two Associated Magic Rectangles order 3 x 4 with s3 = 3 * s1 / 7 and s4 = 4 * s1 / 7

Based on this definition a routine can be developed to generate subject Composed Magic Squares (ref. Priem7e3).

Attachment 14.6.30 shows for miscellaneous Magic Sums the first occurring Prime Number Composed Magic Square.

It should be noted that the reversed transformation is not necessarily possible because of the bottom-left / top-right Main Diagonal.

14.5.8 Ultra Magic Squares (7 x 7)

Based on the equations defining an Associated Pan Magic Square (Ultra Magic) of the seventh order:

```a(43) =       s1   - a(44) - a(45) - a(46) - a(47) - a(48) - a(49)
a(36) =       s1   - a(37) - a(38) - a(39) - a(40) - a(41) - a(42)
a(35) =   6 * s1/7 - a(41) - a(42) - a(47) - a(48) - a(49)
a(34) =              a(35) + a(37) - a(40) + a(44) + a(45) - a(46) - a(48)
a(33) =   6 * s1/7 + a(38) - a(39) - a(40) - a(41) + a(44) - 2 * a(47) - a(48) - a(49)
a(32) =   6 * s1/7 - a(38) - a(40) - a(44) - a(46) - a(48)
a(31) =  12 * s1/7 - a(33) - a(37) - 2 * a(39) - a(41) - a(43) - 2 * a(45) - 2 * a(47) - a(49)
a(30) = - 8 * s1/7 + a(39) + a(40) + 2 * a(41) + a(42) - a(44) + 2 * a(47) + 2 * a(48) + a(49)
a(29) = - 8 * s1/7 + a(38) + a(39) + a(40) + a(41) + a(42) + a(46) + a(47) + a(48) + a(49)
a(28) =       s1/7 - a(37) + a(41) - a(44) - a(45) + a(47) + a(48)
a(27) = -13 * s1/7 + a(39) + 2*a(40) + 2*a(41) + 2*a(42) - a(44) - a(45) + a(46) + 3*a(47) + 3*a(48) + 2*a(49)
a(26) =              a(27) + a(36) - a(42) + a(45) - a(47)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate Ultra Magic Squares of order 7 (ref. Priem7c).

Attachment 14.6.11 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with numerous squares for the applicable Magic Sum and variable values {ai}.

14.5.9 Ultra Magic Squares, Order 3 Concentric Square and Square Inlay (a)

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Concentric Square and Square Inlay (a):

```a(45) = (    s1   - 2 * a(48) - a(32) - 2 * a(33)) / 2
a(44) =  4 * s1/7 - a(45) - a(47) - a(48)
a(43) =  3 * s1/7 - a(46) - a(49)
a(40) = (9 * s1/7 - 2 * a(48) - 2 * a(32) - 2 * a(33) - a(46)) / 2
a(39) =  3 * s1/7 - a(41) - 2 * a(47) + a(32) + a(33) - a(49)
a(38) = -    s1   + a(40) + a(45) + a(47) + 2 * a(48) + a(32) + 2 * a(33)
a(37) = -    s1   + a(41) + 2 * a(47) + 2 * a(48) + a(46) + 2 * a(49)
a(36) =  9 * s1/7 - a(41) - a(42) - a(45) - a(47) - 2 * a(48) - a(33) - a(49)
a(35) =  6 * s1/7 - a(41) - a(42) - a(47) - a(48) - a(49)
a(34) =  3 * s1/7 - a(40) - a(42) - a(48) + a(49)
a(31) =  3 * s1/7 - a(32) - a(33)
a(30) = -9 * s1/7 + a(40) + a(41) + a(42) + a(45) + a(47) + 3 * a(48) + a(32) + a(33)
a(29) = -3 * s1/7 + a(42) + a(45) + a(48) + a(33)
a(28) =  4 * s1/7 - a(46) - 2 * a(49)
a(27) = -5 * s1/7 + a(41) + 2 * a(42) + 2 * a(47) + 2 * a(48) - a(32) - a(33) + a(49)
a(26) =  4 * s1/7 - a(32) - 2 * a(33)
a(25) =      s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7f1).

Attachment 14.6.14 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.10 Ultra Magic Squares, Order 3 Concentric Square and Square Inlay (b)

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Concentric Square and Square Inlay (b):

```a(46) =       s1   - 2 * a(48) - a(49) - a(32) - a(33) - a(41)
a(44) =  -6 * s1/7 + a(45) + a(47) + a(48) + a(49) + a(33) + a(39) + a(41)
a(43) =   6 * s1/7 - 2 * a(45) - 2 * a(47) - a(49) + a(32) - a(39)
a(42) = (-    s1/7 + 2 * a(45) + a(32) + 2 * a(33) - 2 * a(41))/2
a(40) = ( 5 * s1/7 - 2 * a(47) - a(39))/2
a(38) =            a(40) - a(45) + a(47)
a(37) =   3 * s1/7 - a(39) - a(41)
a(36) =  -    s1/7 - a(42) + a(45) + a(47) + a(39)
a(35) =   6 * s1/7 - a(42) - a(47) - a(48) - a(49) - a(41)
a(34) =   3 * s1/7 - a(35) - a(40) - a(47) + a(41)
a(31) =   3 * s1/7 - a(32) - a(33)
a(30) =  -3 * s1/7 - a(36) + a(38) + a(45) + a(47) + a(48) - a(33) + a(39) + a(41)
a(29) =   4 * s1/7 - a(30) - a(34) - a(35)
a(28) =   4 * s1/7 - 2 * a(45) - a(49) - a(33) + a(41)
a(27) =   4 * s1/7 - a(39) - 2 * a(41)
a(26) =   4 * s1/7 - a(32) - 2 * a(33)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7f2).

Attachment 14.6.15 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.11 Ultra Magic Squares, Order 3 Square Inlays

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Square Inlays:

```a(47) = (10 * s1/7 - 2 * a(48) - a(39) - 2 * a(41) - a(46) - 2 * a(49))/2
a(44) =   4 * s1/7 - a(45) - a(47) - a(48)
a(43) =   3 * s1/7 - a(46) - a(49)
a(40) =  (    s1/7 - 2 * a(42) + a(46) + 2 * a(49))/2
a(37) =   3 * s1/7 - a(39) - a(41)
a(36) =   4 * s1/7 - a(38) - a(40) - a(42)
a(35) =   6 * s1/7 - a(42) - a(47) - a(48) - a(41) - a(49)
a(34) =   3 * s1/7 - a(40) - a(42) - a(48) + a(49)
a(33) =              a(38) - a(40) - a(45) - a(47) + a(41) + a(46) + a(49)
a(32) =       s1/7 - a(38) + a(40) + 2 * a(42) + a(45) + a(47) - 2 * a(46) - 2 * a(49)
a(31) = - 4 * s1/7 - a(38) + a(40) - a(45) + a(47) + 2 * a(48) + a(41) + a(46) + a(49)
a(30) = - 2 * s1/7 + a(40) + a(42) + a(45) + a(47) + a(48) - a(46) - a(49)
a(29) =   3 * s1/7 + a(38) - a(40) - a(42) - a(47) - a(48) - a(41) + a(46) + a(49)
a(28) =   4 * s1/7 - a(46) - 2 * a(49)
a(27) =   4 * s1/7 - a(39) - 2 * a(41)
a(26) =   8 * s1/7 - a(38) - a(40) - 2 * a(42) + a(45) - a(47) - a(39) - 2 * a(41)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7e5).

Attachment 14.6.16 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.12 Ultra Magic Squares, Order 3 Square and Diamond Inlay (a)

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Square and Diamond Inlay:

```a(44) =   4 * s1/7 - a(45) - a(47) - a(48)
a(43) =   3 * s1/7 - a(46) - a(49)
a(41) =   6 * s1/7 - a(45) - 2 * a(47) - a(48) - a(49)
a(40) =   4 * s1/7 - a(42) + a(45) - a(48) - a(39) - (a(33) + a(46))/2
a(37) = -     s1/7 - a(45) + a(48) + a(46) + a(49)
a(38) =            - a(42) + a(45) + a(47) + (a(33) - a(46))/2
a(36) = - 2 * s1/7 + a(42) + a(47) + a(48)
a(35) =            - a(42) + a(45) + a(47)
a(34) = -     s1/7 - a(45) + a(39) + a(49) + (a(33) + a(46))/2
a(32) = - 2 * s1/7 + 2 * a(42) - a(45) + a(48) + a(39)
a(31) =   4 * s1/7 - a(33) - 2 * a(39)
a(30) =   4 * s1/7 - a(47) - a(49) - (a(33) + a(46))/2
a(29) =   2 * s1/7 - a(42) + a(45) -  a(48)
a(28) =   4 * s1/7 - a(46) - 2 * a(49)
a(27) =   3 * s1/7 - a(33) - a(39)
a(26) =       s1/7 + a(45) + a(48) - a(33) - a(39)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7g1).

Attachment 14.6.17 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

It should be noted that the routine Priem7g1 searched only those solutions per Magic Sum which could be found within 30 seconds.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.13 Ultra Magic Squares, Order 3 Square and Diamond Inlay (b)

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Square and Diamond Inlay:

```a(44) =   2 * s1/7 + a(45) - a(46) + a(47) - a(48) - a(39)
a(43) =   5 * s1/7 - 2 * a(45) - 2 * a(47) - a(49) + a(39)
a(40) = (19 * s1/7 - 2 * a(42) + 2 * a(45) - 2 * a(46) - 2*a(47) - 4*a(48) - 2*a(49) - 3*a(39) - 4*a(41))/2
a(38) = (     s1/7 - 2 * a(42) + a(39) + 2 * a(41))/2
a(37) =   3 * s1/7 - a(39) - a(41)
a(36) = - 6 * s1/7 + a(42) - a(45) + a(46) + a(47) + 2 * a(48) + a(49) + a(39) + a(41)
a(35) =   6 * s1/7 - a(42) - a(47) - a(48) - a(49) - a(41)
a(34) =   2 * s1/7 - a(38) - a(42) + a(45) - a(46) + a(47) - a(48) + a(41)
a(33) = -     s1/7 + 2 * a(41)
a(32) = - 6 * s1/7 + 2 * a(42) - 2 * a(45) + a(46) + 2 * a(48) + a(49) + 2 * a(39) + a(41)
a(31) =   5 * s1/7 - 2 * a(39) - 2 * a(41)
a(30) = -     s1/7 + a(38) + a(42) + a(48) - a(41)
a(29) =   2 * s1/7 - a(42) + a(45) - a(48)
a(28) = - 4 * s1/7 - 2 * a(45) + a(46) + 2 * a(48) + 2 * a(39) + 2 * a(41)
a(27) =   4 * s1/7 - a(39) - 2 * a(41)
a(26) = - 2 * s1/7 + a(46) + 2 * a(48) + a(49) - a(41)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7g2).

Attachment 14.6.18 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

It should be noted that the routine Priem7g2 searched only those solutions per Magic Sum which could be found within 30 seconds.

Each square shown corresponds with eight (Check) squares for the applicable Magic Sum and variable values {ai}.

14.5.14 Ultra Magic Squares, Order 3 Concentric Square and Diamond Inlay

Based on the equations defining seventh order Ultra Magic Squares with Order 3 Concentric Square and Diamond Inlay:

```a(43) =       s1   - a(44) - a(45) - a(46) - a(47) - a(48) - a(49)
a(42) = (-3 * s1/7 + 2 * a(45) + a(33) + 2 * a(39))/2
a(41) =   6 * s1/7 + a(44) - a(45) - a(47) - a(48) - a(49) - a(33) - a(39)
a(40) = (     s1   - a(44) + a(45) - a(46) - a(47) - a(48) - 2 * a(39))/2
a(38) =            a(40) - a(45) + a(47)
a(37) = - 5 * s1/7 + a(46) + 2 * a(48) + a(49) + a(33) + a(39)
a(36) = (     s1/7 + 2 * a(47) - a(33)) / 2
a(35) =   3 * s1/7 + a(42) - a(44) - a(45) - a(39)
a(34) = - 2 * s1/7 - a(40) + a(42) + a(48) + a(49) + a(33)
a(32) = -     s1/7 + 2 * a(39)
a(31) =   4 * s1/7 - a(33) - 2 * a(39)
a(30) =   8 * s1/7 - a(40) - a(42) + a(45) - a(46) - a(47) - a(48) - a(49) - a(33) - a(39)
a(29) = (     s1   - 2 * a(48) - a(33) - 2 * a(39))/2
a(28) =  12 * s1/7 - 2 * a(45) - a(46) - 2 * a(48) - 2 * a(49) - 2 * a(33) - 2 * a(39)
a(27) =   3 * s1/7 - a(33) - a(39)
a(26) =   5 * s1/7 - 2 * a(33) - 2 * a(39)
a(25) =       s1/7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7h).

Attachment 14.6.19 shows for miscellaneous Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.15 Ultra Magic Squares, Three Cell Patterns

Based on the equations defining seventh order Ultra Magic Squares, for which all Three Cell patterns sum to 3*s1/7:

```a(33) =  3*s1 / 7 - a(34) - a(40)
a(30) =  3*s1 / 7 - a(31) - a(38)
a(46) = -2*s1 / 7 + a(31) + 2 * a(38)
a(32) =  5*s1 / 7 - a(39) - a(31) - 2 * a(38)
a(28) =    s1 / 7 + a(34) - a(40)
a(26) =  2*s1 / 7 - a(27) - a(34) + a(40)
a(47) =  3*s1 / 7 - a(48) - a(49)
a(45) =  7*s1 / 7 - a(48) - a(49) - a(27) - a(31) - a(38) - 2 * a(34) + a(40)
a(44) =  3*s1 / 7 - a(48) + a(39) - a(38) - a(40)
a(43) = -4*s1 / 7 + 2 * a(48) + a(49) + a(27) - a(39) + 2 * a(34)
a(42) =  8*s1 / 7 - a(48) - a(49) - a(31) - 2 * a(38) - 2 * a(34)
a(41) =             a(49) + a(34) - a(40)
a(37) = -7*s1 / 7 + 2 * a(48) + a(49) + a(27) - a(39) + a(31) + 2 * a(38) + 2 * a(34)
a(36) =  6*s1 / 7 - a(48) - a(49) - a(27) - a(38) - a(34)
a(35) = -5*s1 / 7 + a(48) + a(31) + 2 * a(38) + a(34) + a(40)
a(29) =    s1 / 7 - a(48) + a(39) + a(38) - a(34)
a(25) =    s1 / 7
```
 a(24) = 2*s1/7 - a(26) a(23) = 2*s1/7 - a(27) a(22) = 2*s1/7 - a(28) a(21) = 2*s1/7 - a(29) a(20) = 2*s1/7 - a(30) a(19) = 2*s1/7 - a(31) a(18) = 2*s1/7 - a(32) a(17) = 2*s1/7 - a(33) a(16) = 2*s1/7 - a(34) a(15) = 2*s1/7 - a(35) a(14) = 2*s1/7 - a(36) a(13) = 2*s1/7 - a(37) a(12) = 2*s1/7 - a(38) a(11) = 2*s1/7 - a(39) a(10) = 2*s1/7 - a(40) a( 9) = 2*s1/7 - a(41) a( 8) = 2*s1/7 - a(42) a( 7) = 2*s1/7 - a(43) a(6) = 2*s1/7 - a(44) a(5) = 2*s1/7 - a(45) a(4) = 2*s1/7 - a(46) a(3) = 2*s1/7 - a(47) a(2) = 2*s1/7 - a(48) a(1) = 2*s1/7 - a(49)

a routine can be written to generate subject Ultra Magic Squares of order 7 (ref. Priem7d).

Attachment 14.6.20 shows for a few Magic Sums the first occurring Prime Number Ultra Magic Square.

Each square shown corresponds with eight squares for the applicable Magic Sum and variable values {ai}.

14.5.16 Summary

The obtained results regarding the miscellaneous types of order 7 Prime Number Magic Squares as deducted and discussed in previous sections are summarized in following table:

 Type Characteristics Subroutine Results Concentric - Bordered Miscellaneous Inlays Eccentric General Overlapping Sub Squares Associated Overlapping Sub Squares (4 x 4) Diamond Inlays Order 3 and 4 Square  Inlays Order 3 and 4 Composed Associated Corner Squares and - Rectangles Ultra Magic General Concentric, Square Inlay (a) Concentric, Square Inlay (b) Order 3 Square Inlays Order 3 Square and Diamond Inlay (a) Order 3 Square and Diamond Inlay (b) Concentric, Diamond Inlay Three Cell Patterns
 Comparable routines as listed above, can be used to generate Prime Number Magic Squares of order 8, which will be described in following sections.