Office Applications and Entertainment, Magic Squares Index About the Author

14.0    Special Magic Squares, Prime Numbers

14.15   V type ZigZag

When a Magic Square contains repeated wave type patterns (see below) summing to the Magic Sum s1, it is called a V type ZigZag Magic Square.

Top/Bottom
 o - o - o - o - o - - - - - - - - - - - - - - - -
Left/Right
 o - - - - - o - - - o - - - - - o - - - o - - - -

As illustrated above the repetition can be in the directions:

- Top / Bottom with wrap around and reverse
- Left / Right with wrap around and reverse

If one of these options occurs, the Magic Square is referred to as a Two Way V type ZigZag Magic Square.

If both options are applicable, the Magic Square is referred to as a Four Way V type ZigZag Magic Square.
Such squares occur only for orders larger than 5.

14.15.1 Magic Squares (4 x 4)
Two Way, V type ZigZag

The defining equations for a Two Way (Top/Bottom) V type ZigZag Magic Square of order 4 can be written as:

```a(11) =  s1 - a(12) -   a(15) - a(16)
a( 7) = -s1 + a( 8) + 2*a(12) + a(15) + a(16)
a( 4) =  s1 - a( 8) -   a(12) - a(16)
a( 3) =  s1 - a( 8) -   a(12) - a(15)

a(14) = 0.5 * s1 - a(16)        a(9) = 0.5 * s1 - a(11)
a(13) = 0.5 * s1 - a(15)        a(5) = 0.5 * s1 - a( 7)
a(10) = 0.5 * s1 - a(12)        a(2) = 0.5 * s1 - a( 4)
a( 6) = 0.5 * s1 - a( 8)        a(1) = 0.5 * s1 - a( 3)
```

which illustrate the consequential symmetry (column symmetrical).

Subject equations can be incorporated in a routine to generate Two Way V type ZigZag Magic Squares (ref. ZigZag4).

Attachment 17.01 shows for miscellaneous Magic Sums the first occurring Two Way V type ZigZag Magic Square.

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

14.15.2 Magic Squares (5 x 5)
Two Way, V type ZigZag

The defining equations for a Two Way (Top/Bottom) V type ZigZag Magic Square of order 5 can be written as:

```a( 1) =  0.6 * s1 - a( 3) - a( 5)
a( 2) =  0.4 * s1 - a( 4)
a( 3) =           2*a(13) - a(23)
a( 4) =    2 * s1 - a(10) + a(13) - a(14) - a(15) - 2 * a(19) - a(20) - a(23) - a(24) - 2 * a(25)
a( 5) =        s1 - a(10) - a(15) - a(20) - a(25)
a( 6) =  0.6 * s1 - a( 8) - a(10)
a( 8) =        s1 - 3 * a(13) - a(18)
a( 7) =  0.4 * s1 - a( 9)
a( 9) =      - s1 + a(10) - a(13) + a(15) + a(19) + a(20) + a(23) + 2 * a(25)
a(12) =  0.4 * s1 - a(14)
a(11) =  0.6 * s1 - a(13) - a(15)
a(17) =  0.4 * s1 - a(19)
a(16) =  0.6 * s1 - a(18) - a(20)
a(22) =  0.4 * s1 - a(24)
a(21) =  0.6 * s1 - a(23) - a(25)
```

The consequential symmetry (Columns 2 - 4) is worth to be noticed and the reason that Two Way V type ZigZag Magic Squares of the fifth order can't be Associated or Pan Magic.

Subject equations can be incorporated in a routine to generate Two Way V type ZigZag Magic Squares (ref. ZigZag5).

Attachment 17.02 shows for miscellaneous Magic Sums the first occurring Two Way V type ZigZag Magic Square.

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

14.15.3 Magic Squares (6 x 6)

Two Way V type ZigZag

Rectangular Compact, Row Symmetric, Pan Magic Squares as deducted and discussed in Section 14.4.34 are Two Way V type ZigZag.

Attachment 6.10.5 shows for miscellaneous Magic Sums the first occurring Rectangular Compact, Row Symmetric, Pan Magic Squares (ref. MgcSqr6105).

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

Four Way V type ZigZag

The defining equations for a Four Way V type ZigZag Pan Magic Square of order 6 can be written as:

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

which illustrate the consequential symmetry (complete).

Subject equations can be incorporated in a routine to generate Four Way V type ZigZag Pan Magic Squares (ref. ZigZag6).

Attachment 17.03 shows for miscellaneous Magic Sums the first occurring Four Way V type ZigZag Pan Magic Square.

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

Construction Method

Four Way V type ZigZag Magic Square of order 6 can be constructed by transformation of Composed Magic Squares (ref. Section 14.4.10).

Following Composed Magic Squares can be used:

A1 Attachment 14.8.4, Simple Magic Squares, Composed of Semi Magic Sub Squares
A2 Attachment 14.8.5, Associated Magic Squares, Composed of Anti Symmetric Semi Magic Sub Squares
A3 Attachment 14.8.6, Pan Magic Complete Squares, Composed of Anti Symmetric Semi Magic Sub Squares

and will return respectively:

Four Way V type ZigZag Simple Magic Squares B1 as illustrated below for MC = 4878:

A1 (Simple)
 1289 1013 137 367 1429 643 953 167 1319 613 337 1489 197 1259 983 1459 673 307 617 1049 773 1123 967 349 659 503 1277 739 463 1237 1163 887 389 577 1009 853
B1 (Simple)
 1289 367 1013 1429 137 643 617 1123 1049 967 773 349 953 613 167 337 1319 1489 659 739 503 463 1277 1237 197 1459 1259 673 983 307 1163 577 887 1009 389 853

Each suitable set of Semi Magic Sub Squares corresponds with 24 * 124 = 497664 Prime Number Four Way V type ZigZag Simple Magic Squares of order 6.

Four Way V type ZigZag Associated Magic Squares B2 as illustrated below for MC = 2850:

A2 (Associated)
 643 709 73 127 727 571 769 43 613 541 97 787 13 673 739 757 601 67 883 349 193 211 277 937 163 853 409 337 907 181 379 223 823 877 241 307
B2 (Associated)
 643 127 709 727 73 571 883 211 349 277 193 937 769 541 43 97 613 787 163 337 853 907 409 181 13 757 673 601 739 67 379 877 223 241 823 307

Each suitable set of Anti Symmetric Semi Magic Sub Squares corresponds with 8 * 122 = 1152 Prime Number Four Way V type ZigZag Associated Magic Squares of order 6.

Four Way V type ZigZag Crosswise Symmetric Magic Squares B3 as illustrated below for MC = 1638:

A3 (PM Complete)
 443 239 137 353 317 149 263 383 173 419 233 167 113 197 509 47 269 503 193 229 397 103 307 409 127 313 379 283 163 373 499 277 43 433 349 37
B3 (Cross Symm)
 443 353 239 317 137 149 193 103 229 307 397 409 263 419 383 233 173 167 127 283 313 163 379 373 113 47 197 269 509 503 499 433 277 349 43 37

Each suitable set of Anti Symmetric Semi Magic Sub Squares corresponds with 8 * 122 = 1152 Prime Number Four Way V type ZigZag Crosswise Symmetric Magic Squares of order 6.

Notes:
For the Associated Magic Squares B2 also the Semi Diagonals sum to the Magic Sum.
For the Crosswise Symmetric Magic Squares B3 also half of the Broken Diagonals sum to the Magic Sum.

14.15.4 Magic Squares (7 x 7)

Although Two and Four Way V type ZigZag Simple Magic Squares of order 7 do exist, this section is limited to seventh order Ultra and Associated Magic Squares.

Two Way V type ZigZag

The defining equations for a Two Way (Top/Bottom) V type ZigZag Ultra Magic Square of order 7 can be written as:

```a(44) =  3*s1/7 - a(46) - a(48)
a(43) =  4*s1/7 - a(45) - a(47) - a(49)
a(38) =    s1/7 - a(40) + a(45) - a(46) + a(47)
a(37) =  3*s1/7 - a(39) - a(41)
a(36) =  3*s1/7 - a(42) - a(45) + a(46) - a(47)
a(35) =  6*s1/7 - a(41) - a(42) - a(47) - a(48) - a(49)
a(34) = 12*s1/7 - a(39) - a(40) - 2 * a(41) - a(42) + a(45) - 2 * a(46) - a(47) - 3 * a(48) - a(49)
a(33) = 10*s1/7 - a(39) - 2 * a(40) - a(41) + a(45) - 2 * a(46) - a(47) - 2 * a(48) - a(49)
a(32) =  2*s1/7 - a(45) + a(46) - a(47)
a(31) =- 5*s1/7 + 2 * a(40) + a(41) - 2 * a(45) + 2 * a(46) + 2 * a(48) + a(49)
a(30) =-11*s1/7 + a(39) + a(40) + 2 * a(41) + a(42) + a(46) + 2 * a(47) + 3 * a(48) + a(49)
a(29) =-   s1   + a(39) + a(41) + a(42) + a(45) + 2 * a(47) + a(48) + a(49)
a(28) =- 5*s1/7 + a(39) + 2 * a(41) - a(45) + a(46) + a(47) + 2 * a(48)
a(27) =-16*s1/7 + a(39) + 2 * a(40) + 2 * a(41) + 2 * a(42) - a(45) + 2*a(46) + 3*a(47) + 4*a(48) + 2*a(49)
a(26) =-13*s1/7 + a(39) + 2 * a(40) + 2 * a(41) - a(45) + 3 * a(46) + a(47) + 4 * a(48) + 2*a(49)
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)

Subject equations can be incorporated in a routine to generate Two Way V type ZigZag Ultra Magic Squares (ref. ZigZag7a).

Attachment 17.04 shows for a few Magic Sums the first occurring Two Way V type ZigZag Ultra Magic Square.

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

Four Way V type ZigZag

Associated Magic Squares of order 7 with Square Inlays of Order 3 and 4 - as deducted and discussed in Section 14.5.7 - are Four Way V type ZigZag.

Attachment 14.6.13 shows for miscellaneous Magic Sums the first occurring Associated Magic Square with order 3 and 4 Square Inlays (Priem7e2).

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

14.15.5 Magic Squares (8 x 8)
Four Way V type ZigZag

Complete Pan Magic Squares

Four Way V type ZigZag Magic Squares of order 8 can be constructed by transformation of Composed Magic Squares (ref. Section 14.6.1).

A self explanatory numerical example (Pan Magic Sub Squares) is shown below for MC = 3360:

A
 71 89 733 787 83 97 739 761 691 829 29 131 673 827 17 163 107 53 769 751 101 79 757 743 811 709 149 11 823 677 167 13 227 193 599 661 293 337 443 607 439 821 67 353 349 701 199 431 241 179 613 647 397 233 547 503 773 487 401 19 641 409 491 139
B
 71 83 89 97 733 739 787 761 227 293 193 337 599 443 661 607 691 673 829 827 29 17 131 163 439 349 821 701 67 199 353 431 107 101 53 79 769 757 751 743 241 397 179 233 613 547 647 503 811 823 709 677 149 167 11 13 773 641 487 409 401 491 19 139

If the 4 Sub Squares of Square A are Pan Magic, the resulting Square B will be Pan Magic, Complete and 4 x 4 Compact.

Each suitable set of Pan Magic Sub Squares corresponds with 24 * 3844 = 0,5 1012 Prime Number Four Way V type ZigZag Pan Magic Squares of order 8.

17.15.6 Magic Squares (9 x 9)
Four Way V type ZigZag

Associated Magic Squares of order 9 with Square Inlays of Order 4 and 5 - as deducted and discussed in Section 14.7.13 - are Four Way V type ZigZag.

Attachment 14.7.12 shows miscellaneous Associated Magic Squares with order 4 and 5 Square Inlays, based on transformation of Composed Magic Squares (Priem9f3).

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

14.15.7 Magic Squares (10 x 10)
Four Way V type ZigZag

Four Way V type ZigZag Magic Square of order 10 can be constructed by transformation of Composed Magic Squares (ref. Section 14.8.5).

Following Composed Magic Squares can be used:

A1 Attachment 14.8.66, Associated Magic Squares, Composed of Anti Symmetric Magic Sub Squares
A2 Attachment 14.8.67, Pan Magic Complete Squares, Composed of Anti Symmetric Magic Sub Squares

and will return respectively:

Four Way V type ZigZag Associated Magic Squares B1 as illustrated below for MC = 26950:

A1 (Associated)
 4153 3823 877 829 3793 1861 2953 1423 2269 4969 1783 661 2797 3631 4603 4933 2161 1459 1663 3259 1129 5077 1933 2677 2659 271 5233 4813 2389 769 3019 727 4759 4639 331 4657 277 3697 2503 2341 3391 3187 3109 1699 2089 1753 2851 2083 4651 2137 3253 739 3307 2539 3637 3301 3691 2281 2203 1999 3049 2887 1693 5113 733 5059 751 631 4663 2371 4621 3001 577 157 5119 2731 2713 3457 313 4261 2131 3727 3931 3229 457 787 1759 2593 4729 3607 421 3121 3967 2437 3529 1597 4561 4513 1567 1237
B1 (Associated)
 4153 1861 3823 2953 877 1423 829 2269 3793 4969 3253 3301 739 3691 3307 2281 2539 2203 3637 1999 1783 4933 661 2161 2797 1459 3631 1663 4603 3259 3049 5059 2887 751 1693 631 5113 4663 733 2371 1129 271 5077 5233 1933 4813 2677 2389 2659 769 4621 2731 3001 2713 577 3457 157 313 5119 4261 3019 4657 727 277 4759 3697 4639 2503 331 2341 2131 787 3727 1759 3931 2593 3229 4729 457 3607 3391 1753 3187 2851 3109 2083 1699 4651 2089 2137 421 1597 3121 4561 3967 4513 2437 1567 3529 1237
 Each suitable set of Anti Symmetric Magic Sub Squares corresponds with numerous Prime Number Four Way V type ZigZag Assiciated Magic Squares of order 10. Four Way V type ZigZag Croswise Symmetric Magic Squares B2 as illustrated below for MC = 26950:
A2 (PM Complete)
 4153 3823 877 829 3793 4969 2269 1423 2953 1861 1783 661 2797 3631 4603 3259 1663 1459 2161 4933 1129 5077 1933 2677 2659 769 2389 4813 5233 271 3019 727 4759 4639 331 2341 2503 3697 277 4657 3391 3187 3109 1699 2089 2137 4651 2083 2851 1753 421 3121 3967 2437 3529 1237 1567 4513 4561 1597 2131 3727 3931 3229 457 3607 4729 2593 1759 787 4621 3001 577 157 5119 4261 313 3457 2713 2731 3049 2887 1693 5113 733 2371 4663 631 751 5059 3253 739 3307 2539 3637 1999 2203 2281 3691 3301
B2 (Cross Symm)
 4153 4969 3823 2269 877 1423 829 2953 3793 1861 421 1237 3121 1567 3967 4513 2437 4561 3529 1597 1783 3259 661 1663 2797 1459 3631 2161 4603 4933 2131 3607 3727 4729 3931 2593 3229 1759 457 787 1129 769 5077 2389 1933 4813 2677 5233 2659 271 4621 4261 3001 313 577 3457 157 2713 5119 2731 3019 2341 727 2503 4759 3697 4639 277 331 4657 3049 2371 2887 4663 1693 631 5113 751 733 5059 3391 2137 3187 4651 3109 2083 1699 2851 2089 1753 3253 1999 739 2203 3307 2281 2539 3691 3637 3301
 Each suitable set of Anti Symmetric Magic Sub Squares corresponds with numerous Prime Number Four Way V type ZigZag Crosswise Symmetric Magic Squares of order 10. Notes: For the Associated Magic Squares B1 also the Semi Diagonals sum to the Magic Sum. For the Crosswise Symmetric Magic Squares B2 also half of the Broken Diagonals sum to the Magic Sum. 14.15.8 Magic Squares (11 x 11)         Four Way V type ZigZag Associated Magic Squares of order 11 with Square Inlays of Order 5 and 6 - as deducted and discussed in Section 14.9.9 - are Four Way V type ZigZag. Attachment 14.8.16 shows miscellaneous Associated Magic Squares with order 5 and 6 Square Inlays, based on transformation of Composed Magic Squares (Prime11c1). Each square shown corresponds with numerous squares for the applicable Magic Sum and variable values {ai}. 14.15.9 Summary The obtained results regarding the miscellaneous types of ZigZag Magic Squares as deducted and discussed in previous sections are summarized in following table:
 Order Characteristics Subroutine Results 4 Two  Way V ZigZag 5 Two  Way V ZigZag 6 Two  Way V ZigZag, Rect. Compact, Row Symmetric, Pan Magic Four Way V ZigZag, Pan Magic, Complete 7 Two  Way V ZigZag, Ultra Magic Four Way V ZigZag, Associated, Inlaid 9 Four Way V ZigZag, Associated, Inlaid 11 Four Way V ZigZag, Associated, Inlaid
 Following sections will describe and illustrate how Prime Number (Pan) Magic Squares can be constructed based on the sum of suitable selected Latin Squares.