The key to construct an ultra magic 13x13 square is 0 - 12 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11
The second grid is a reflection (rotated by a quarter and mirrored) of the first grid.
Take 1x number from the first grid +1
0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 |
12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 |
11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 | 5 | 6 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 | 3 | 4 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 | 1 | 2 |
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 0 | 12 |
+ 13x number from second grid
0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 |
12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 |
1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 |
2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 |
3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 |
4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 |
5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 |
6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 |
7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 |
8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 |
9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 | 11 |
10 | 8 | 6 | 4 | 2 | 12 | 11 | 9 | 7 | 5 | 3 | 1 | 0 |
11 | 9 | 7 | 5 | 3 | 1 | 0 | 10 | 8 | 6 | 4 | 2 | 12 |
= Ultra magic 13x13 square
1 | 143 | 106 | 81 | 56 | 31 | 162 | 150 | 125 | 100 | 75 | 50 | 25 |
167 | 155 | 118 | 104 | 67 | 42 | 17 | 5 | 136 | 111 | 86 | 61 | 36 |
22 | 10 | 141 | 116 | 79 | 65 | 28 | 159 | 147 | 122 | 97 | 72 | 47 |
33 | 164 | 152 | 127 | 102 | 77 | 40 | 26 | 2 | 133 | 108 | 83 | 58 |
44 | 19 | 7 | 138 | 113 | 88 | 63 | 38 | 157 | 156 | 119 | 94 | 69 |
55 | 30 | 161 | 149 | 124 | 99 | 74 | 49 | 24 | 12 | 131 | 117 | 80 |
78 | 41 | 16 | 4 | 135 | 110 | 85 | 60 | 35 | 166 | 154 | 129 | 92 |
90 | 53 | 39 | 158 | 146 | 121 | 96 | 71 | 46 | 21 | 9 | 140 | 115 |
101 | 76 | 51 | 14 | 13 | 132 | 107 | 82 | 57 | 32 | 163 | 151 | 126 |
112 | 87 | 62 | 37 | 168 | 144 | 130 | 93 | 68 | 43 | 18 | 6 | 137 |
123 | 98 | 73 | 48 | 23 | 11 | 142 | 105 | 91 | 54 | 29 | 160 | 148 |
134 | 109 | 84 | 59 | 34 | 165 | 153 | 128 | 103 | 66 | 52 | 15 | 3 |
145 | 120 | 95 | 70 | 45 | 20 | 8 | 139 | 114 | 89 | 64 | 27 | 169 |
This 13x13 magic square is panmagic and symmetric.
You can use this method to construct ultra magic squares of order is prime number from 5x5 to infinity. See 5x5, 7x7, 11x11, 13x13, 17x17, 19x19, 23x23, 29x29, 31x31