Octagon Algorithm for Wheel Magic Squares (Part III)
The Eight Node Way - 9×9 Squares
The previous section Part II introduced the Octagon A algorithm for the construction of 7×7 Wheel Squares. This section will cover the 9th order squares. The square will be built according to Part I starting with the initial node at top left of the octagon.
The squares will be constructed, however, with only partial coding for the wheel portion but not for the complete magic square since the octagon method requires an inordinate amount of code. The reason being that while and for loops cannot be used to fill in the cells as discussed in Part I.
Six 9×9 examples are shown below. Starting with the construction of the Wheel 9(0)-1 one may use the Octagon A algorithm to fill in the rest of the white cells a number of ways. Magic Square 9(0)-1 is generated by initially placing the number 13 in the second top cell [position (0,1)] then adding the rest of the numbers as shown. Note that position is defined here as (row,column) where the first cell is (0,0) and the grey cells are sums, where every row, column and diagonals must add up at the end to the magic sum 369.
Wheel 9(0)-1
77 | | |
| 1 |
| | | 45 |
123 |
| 76 | |
| 2 | |
| 44 |
| 122 |
| | 75 |
| 3 |
| 43 | |
| 121 |
| | |
74 | 4 |
42 | | | |
120 |
9 | 10 |
11 | 12 |
41 | 70 |
71 | 72 |
73 | 369 |
| | |
40 | 78 |
8 | | | |
122 |
| | 39 |
| 79 |
| 7 | |
| 121 |
| 38 | |
| 80 | |
| 6 |
| 124 |
37 | | |
| 81 |
| | | 5 |
123 |
123 | 124 | 125 |
126 | 369 | 120 |
121 | 122 | 123 |
369 |
|
⇒ |
Magic Square 9(0)-1
77 | 13 | 17 |
21 | 1 |
61 | 65 | 69 | 45 |
369 |
16 | 76 | 25 |
29 | 2 |
53 |
57 | 44 |
67 | 369 |
20 | 28 | 75 |
33 | 3 |
49 | 43 | 55 |
63 | 369 |
24 | 32 | 36 |
74 | 4 |
42 | 47 |
51 | 59 |
369 |
9 | 10 |
11 | 12 |
41 | 70 |
71 | 72 |
73 | 369 |
58 | 50 | 46 |
40 | 78 |
8 | 35 | 31 | 23 |
369 |
62 | 54 | 39 |
48 | 79 |
34 | 7 | 27 |
19 | 369 |
66 | 38 | 56 |
52 | 80 | 30 |
26 | 6 |
15 | 369 |
37 | 68 | 64 |
60 | 81 |
22 | 18 | 14 | 5 |
369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 |
|
Magic Square 9(0)-2 is generated by initially placing the number 13 in the fourth top cell [position (0,3)] then working backwards to fill in the cells. Magic Square 9(0)-3 is generated by placing the 13 internally in a green cell [position (2,3)] and working outward towards the perimeter of the square.
Magic Square 9(0)-2
77 | 21 | 17 |
13 | 1 |
69 | 65 | 61 | 45 |
369 |
24 | 76 | 29 |
25 | 2 |
57 |
53 | 44 |
59 | 369 |
20 | 32 | 75 |
33 | 3 |
49 | 43 | 51 |
63 | 369 |
16 | 28 | 36 |
74 | 4 |
42 | 47 |
55 | 67 |
369 |
9 | 10 |
11 | 12 |
41 | 70 |
71 | 72 |
73 | 369 |
66 | 54 | 46 |
40 | 78 |
8 | 35 | 27 | 15 |
369 |
62 | 50 | 39 |
48 | 79 |
34 | 7 | 31 |
19 | 369 |
58 | 38 | 52 |
56 | 80 | 26 |
30 | 6 |
23 | 369 |
37 | 60 | 64 |
68 | 81 |
14 | 18 | 22 | 5 |
369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 |
|
|
Magic Square 9(0)-3
77 | 25 | 29 |
33 | 1 |
49 | 53 | 57 | 45 |
369 |
28 | 76 | 17 |
21 | 2 |
61 |
65 | 44 |
55 | 369 |
32 | 20 | 75 |
13 | 3 |
69 | 43 | 63 |
51 | 369 |
36 | 24 | 16 |
74 | 4 |
42 | 67 | 59 | 47 |
369 |
9 | 10 |
11 | 12 |
41 | 70 |
71 | 72 |
73 | 369 |
46 | 58 | 66 |
40 | 78 |
8 | 15 | 23 | 35 |
369 |
50 | 62 | 39 |
68 | 79 |
14 | 7 | 19 |
31 | 369 |
54 | 38 | 64 |
60 | 80 | 22 |
18 | 6 |
27 | 369 |
37 | 56 | 52 |
48 | 81 |
34 | 30 | 26 | 5 |
369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 |
|
Magic Square 9(1)-1 and 9(2)-1 are generated using a different wheel for each square (computer code below) and then filling in the square starting at position (0,1) with the number 13 as was done with Magic Square 9(0)-1.
Magic Square 9(1)-1
75 | 1 | 17 |
21 | 3 |
61 | 65 | 81 | 45 |
369 |
16 | 74 | 25 |
29 | 4 |
53 |
57 | 44 |
67 | 369 |
20 | 28 | 73 |
33 | 5 |
49 | 43 | 55 |
63 | 369 |
24 | 32 | 36 |
72 | 6 |
42 | 47 |
51 | 59 |
369 |
11 | 12 |
13 | 14 |
41 | 68 |
69 | 70 |
71 | 369 |
58 | 50 | 46 |
40 | 76 |
10 | 35 | 31 | 23 |
369 |
62 | 54 | 39 |
48 | 77 |
34 | 9 | 27 |
19 | 369 |
66 | 38 | 56 |
52 | 78 | 30 |
26 | 8 |
15 | 369 |
37 | 80 | 64 |
60 | 79 |
22 | 18 | 2 | 7 |
369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 |
|
|
Magic Square 9(2)-1
73 | 1 | 17 |
21 | 5 |
61 | 65 | 81 | 45 |
369 |
4 | 72 | 25 |
29 | 6 |
53 |
57 | 44 |
79 | 369 |
20 | 28 | 71 |
33 | 7 |
49 | 43 | 55 |
63 | 369 |
24 | 32 | 36 |
70 | 8 |
42 | 47 |
51 | 59 |
369 |
13 | 14 |
15 | 16 |
41 | 66 |
67 | 68 |
69 | 369 |
58 | 50 | 46 |
40 | 74 |
12 | 35 | 31 | 23 |
369 |
62 | 54 | 39 |
48 | 75 |
34 | 11 | 27 |
19 | 369 |
78 | 38 | 56 |
52 | 76 | 30 |
26 | 10 |
3 | 369 |
37 | 80 | 64 |
60 | 77 |
22 | 18 | 2 | 9 |
369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 | 369 | 369 |
369 |
|
Computer Coding for 9×9 Squares
This part contains only the wheel portions Wheel 9(1) and Wheel 9(2) used for the last two magic squares.
This completes the Octagon A method.
To go back to Part II. Go to Part IV. Go back to homepage.
Copyright © 2022 by Eddie N Gutierrez. E-Mail: enaguti1949@gmail.com