Theory of Magic

© by George Jelliss (17 May 2011)

Sections on this page: — Numbered Arrays and ToursMagic Arrays and ToursNatural NumberingsMagic Rectangles
Magic Rectangle ToursMagic SquaresNatural MagicStructures of Some Magic Tours

Supplement: Magic Square Tours 4×4 (now moved to the multimover tours page).

Numbered Arrays and Tours

If we have any assortment of real numbers, all different, arranged on a board of any shape, then it determines an open tour of the board, and a direction of description along the tour, by taking the numbers in order of increasing magnitude. Conversely if we have an open tour, and a direction of description, it determines an ordinal numbering of the cells, 1, 2, ..., C, the last number being the number of cells in the board, and a cardinal numbering of the cells, 0, 1, ..., C−1, which counts the number of moves in the tour. The ordinal numbering is traditionally the one most used.

On a very irregular board it may be possible for all the moves to be of a different coordinate pattern {x, y}, but on a board whose cells are arranged in a repetitive pattern, such as a square or hexagonal lattice, the number of different move patterns available will be less than this. On a square board n×n the number of different types of move possible, ranging from {0, 0} to {n−1, n−1} is n(n+1)/2, i.e. from a corner cell to any cell in the triangle determined by the diagonal and an edge through the corner. From this we may deduct one, since the null move {0, 0} is not permitted in tours.

The main restriction of interest in studying tours is that the number of different types of move shall be kept to a minimum. Hence the interest in tours by a particular type of piece, such as the knight, which has only one type of move {1,2}, or the king, which has two {0,1} and {1,1}. However the general results studied in this Note apply to tours by any type of piece.

If T is the total sum of all C entries on a numbered board then the average value of these is A = T/C and T = CA. In the case of a tour numbered 1, 2, ..., C the average A = (C+1)/2, the arithmetic mean of the first and last numbers. The total of the numbers is thus T = CA = C(C+1)/2, which is the well known rule for summation of an arithmetical progression.

Two numbers adding to 2A are said to be complementary. In an ordinally numbered tour these are the first and last numbers (1 and C), second and next to last numbers (2 and C−1), or generally the k and (C+1−k) numbers. In a symmetrical open tour therefore the pairs of complementary numbers occur at the same distance on either side of the axis or centre of symmetry. When C is an odd number A = (C+1)/2 is the middle number in the sequence and thus occurs on the axis or at the centre. In the case of a symmetric closed tour the numbers in pairs of corresponding cells may have a constant sum or difference, depending on the type of symmetry and the origin and direction of the numbering. (For fuller details of this see the Note on Symmetry.)

In the case of an asymmetric board we can compare one numbering of the board to another by keeping the diagram of the board in a fixed orientation. However in the case of a symmetric board the same numbering can appear in two or more different forms. A square array for example can be shown in eight different orientations by reflection or rotation (but keeping the numerals the usual way up of course!).

For the purposes of comparision and cataloguing it is useful to have rules for displaying a numbered array in a standard orientation. To save space it is usually most convenient to place an oblong array with its longer dimension horizontal. The most popular and simple scheme is that adopted by Frénicle in his catalogue of 4×4 magic squares. This is to reflect or rotate the array, according to its symmetries, so that the smallest corner entry is at the top left. If reflection in the diagonal through the corner is also possible then the extra rule applies that the number to right of the corner should be less than the number below the corner. However no scheme is entirely satisfactory for all purposes. The main disadvantage of this rule, from the point of view of tours, is that the first cell, if not in the top left corner, can appear in any quadrant, and the first move can be in any direction.

Magic Arrays and Tours

The term magic is used in the recreational mathematics literature to refer to arrays of numbers in a geometrical formation in which there is a correspondence between arithmetical and geometrical properties of certain subarrays. All the numbers and all the subarrays of one type should be involved in the magic properties. The arithmetical property calculated is usually the sum, but magic arrays involving multiplication will also be found in books on magic diagrams. The arithmetical properties of symmetric tours, in which the move-numbers assigned to pairs of corresponding cells add or subtract to give a fixed number, is a simple form of magic. The number to which a sub-array adds is termed a magic constant. A magic array can have several different magic constants.

To form a magic array we need a number M that can be expressed as the sum of smaller numbers in several ways. The first case of this is 5 = 1+4 = 2+3. Any arrangement of 1, 2, 3, 4 in a square forms a magic array in which the rows, columns, or diagonals add to 5 or have constant difference 1 or 2:

            1 4    1 4    1 2   1 3    1 2    1 3 
            2 3    3 2    4 3   4 2    3 4    2 4 

The next cases of magic pairs are 6 = 1+5 = 2+4 (omitting 3) and 7 = 1+6 = 2+5 = 3+4 (familar on the opposite faces of standard dice), 8 = 1+7, 2+6, 3+5 (omitting 4), 9 = 1+8, 2+7, 3+6, 4+5. Evidently the odd cases use every number less than M, while in the even cases M/2 is omitted.

The first case of a number that can be expressed as the sum of three smaller numbers in two ways is 8 = 1+2+5 = 1+3+4. With these the most symmetrical array we can form is a simple magic cross. Next we find 9 = 1+2+6 = 1+3+5 = 2+3+4 (3 ways) and 10 = 1+2+7 = 1+3+6 = 1+4+5 = 2+3+5 (4 ways) and 11 = 1+2+8 = 1+3+7 = 1+4+6 = 2+3+6 = 2+4+5 (5 ways) adding one extra line in each case.

However with 12 = 1+2+9 = 1+3+8 = 1+4+7 = 1+5+6 = 2+3+7 = 2+4+6 = 3+4+5 we get two extra lines, making 7 triplets. In this case by omitting the numbers 9 and 8 which each occur only in one magic triplet we are left with a magic array of the numbers 1 to 7 in which each occurs in two or more magic triplets. A magic array in which each number occurs in at least two different magic subarrays may be called a strong magic array (while others are weak).

The next case is 13 = 1+2+10 = 1+3+9 = 1+4+8 = 1+5+7 = 2+3+8 = 2+4+7 = 2+5+6 = 3+4+6 (8 cases) where 10 and 9 are weak. Then 14 = 1+2+11 = 1+3+10 = 1+4+9 = 1+5+8 = 1+6+7 = 2+3+9 = 2+4+8 = 2+5+7 = 3+4+6 (9 cases) where 11 and 10 are weak. Magic arrays are shown for these cases, where the triplets are in straight lines and there are no unused crosspoints within the diagrams. I show two magic numberings of the same diagram in the M = 13 case.

When M = 15 the number of triplets jumps again, to 12 with 1+2+12 = 1+3+11 being the weak ones. The other 10 triplets will form the familiar 3×3 magic square array (discussed below) plus two lines 1+4+10 = 2+3+10 which cut across the pattern.

The first magic constant that is the sum of four different numbers in two ways is 12 = 1+2+3+6 = 1+2+4+5. This cannot be shown with the numbers in separate straight lines since both magic sets contain 1 and 2, but we can use intersecting circles. The next cases are: 13 = 1+2+3+7 = 1+2+4+6 = 1+3+4+5, then 14 = 1+2+3+8 = 1+2+4+7 = 1+2+5+6 = 1+3+4+6 = 2+3+4+5, then 15 = 1+2+3+9 = 1+2+4+8 = 1+2+5+7 = 1+3+4+7 = 1+3+5+6 = 2+3+4+6, then 16 = 1+2+3+10 = 1+2+4+9 = 1+2+5+8 = 1+2+6+7 = 1+3+4+8 = 1+3+5+7 = 1+4+5+6 = 2+3+4+7 = 2+3+5+6. However I am not aware of any interesting diagrams using these.

If m magic subarrays adding to M form a partition of the array (i.e. they are non-overlapping subsets, and include every cell) then T = mM, so M = T/m = CA/m. If the subarrays are also all of the same size n then C = mn and M = nA. A uniform magic array (previously I used the term "normal") is one in which a magic set of n entries adds to the magic constant nA. A pair of complementary numbers adding to 2A is a simple case of this. Apart from the M = 4 and M = 12 cases, the magic arrays shown above are non-uniform since they do not possess this property.

Theorem: A magic tour renumbered in any other arithmetical progression is still magic. Proof: Suppose 1, 2, ..., C replaced by c+d, c+2d, ..., c+xd, ..., c+Cd. Then if two sets of n entries {c+ud, c+vd, c+wd ,...} and {c+rd, c+sd, c+td, ...} add to the same total M then M = nc + (u+v+w+...)d = nc + (r+s+t+...)d from which it follows that u+v+w+... = r+s+t+... as in the ordinal numbering. Thus there is no loss of generality in confining our study to magic tours with the ordinal numbering.

Theorem: The reverse of a magic tour is magic. Proof: Reversing the numbering of a magic tour replaces 1 by C, 2 by C−1, and so on. That is, each number x is replaced by its complement 2A−x. Thus any set of n entries {u, v, w, ...} adding to M is replaced by {2A−u, 2A−v, 2A−w, ...} adding to 2nA−M.

It also follows that the reverse of a uniform magic tour is uniform and has the same magic constant.

Natural Numberings

The natural numberings of a rectangular board m×n place 1 in a corner, proceed along one side to an adjacent corner, then make a leap back to the cell adjacent to the 1 and number the next parallel line of cells, and so on. There are thus eight natural numberings of a rectangle commencing at any of the four corners and proceeding initially along rank or file. If we number the ranks and files similarly, so that each cell is specified by the ordered pair of coordinates (x, y) then the natural numbering assigned to cell (x, y) is the number x + n(y − 1). There is a conflict of conventions however in that we normally scan the cells of a rectangular board line by line from left to right and top to bottom, as in writing or reading text, but in describing the position of a cell on a chessboard, or point on a graph, we usually work from the bottom left corner. On this basis the number assigned to (x, y) is x + n(m − y).

Other ways of writing have been taken as standard in different cultures. For example Chinese and Japanese are written from the bottom right corner and proceed from bottom to top and right to left, while Arabic writing is from right to left and top to bottom. At one time in ancient Greece inscriptions were written 'boustrophedonally', that is in the manner of ploughing, with a reversal of direction at the end of each line instead of a jump. This type of numbering is a special type of wazir or rook tour.

In terms of moves a natural numbering proceeds in {0, 1} wazir moves followed by a leap of type {1, n−1} from the end of a line to the start of the next line; it can thus be regarded as a tour by a two-pattern leaper. If we regard the board as a cylinder, in which the right-hand side of the sheet is curved round to join the left-hand side then the {1, n−-1} can be regarded as a {1, 1} fers move on the cylinder, and the natural numbering is then a king tour.

Because it is so familiar, the magic properties of the natural numbering are often overlooked, but they are considerable. The ranks and files do not add to a magic constant but other sets do. The main magic property is that the numbers in any satin (a set containing one cell from each rank and file) add to the same total (the magic constant). Thus in the case of the chessboard the magic constant is 260 and any arrangement of eight rooks or queens so as to guard all the cells of the board except those on which they stand has the property that the natural numbers of the cells on which the pieces stand always add to 260.

Theorem: In a natural-numbered square every satin adds to the same total. Proof: A satin in a square n×n is a set of n cells with one in each rank and one in each file. Thus in a satin in a naturally numbered square we have n numbers of the form xi + n(yi − 1) where i takes the values 1, 2, ..., n. Since there is one entry in each file this ensures that each possible value of x occurs exactly once. Similarly each possible value of y occurs exactly once. The sum of the numbers in the satin is S(i)[xi + n(yi − 1)] = S(i)[xi] + nS(i)[yi − 1] = [1 + 2 + ... + n] + n[0 + 1 + ... + (n −- 1)] = n(n + 1)/2 + n[n(n − 1)/2] = n(n2 + 1)/2, which is the magic constant.

This property of the satins all adding to the same total is unaltered if the ranks or files of the square are permuted, or of the square is reflected in a diagonal (that is, transposed).

Any array with the sums of satins property I call a satinic square. Natural numberings and their permutes are thus particular cases of satinic squares. In any satinic square the pairs of numbers at opposite corners of any rectangle add to the same total, since in a satin any pair of entries can be replaced by the entries at the other corners of the same rectangle and still leave a satin, and the new satin still adds to the same total.

Also in any satinic square two parallel lines (ranks or files) differ by the same number in every pair of cells. Here is a satinic square that is not a permute of a natural numbering:

           1  2  5  6 
           3  4  7  8 
           9 10 13 14 
          11 12 15 16 

Magic Rectangles

A magic rectangle is a rectangular array, m×n, in which the numbers in each of the m ranks add to a constant M, and the numbers in each of the n files add to a constant N. Evidently M = T/m = nA and N = T/n = mA. Thus a magic rectangle is always a uniform magic array. The magic constants are related by M/N = n/m and mM = nN = T. If only the ranks or only the files add to a magic constant we have a weak magic rectangle, which we call semi-magic.

Theorem: Any k numbers not equal to A can occur in a uniform magic set of 2k or 2k+1 numbers. Proof: Sets consisting of k pairs of complements (when n = 2k) together with the central number A (when n = 2k+1) add to nA, i.e. are uniform magic sets. If n is even than any n/2 numbers can occur together in a uniform magic set since any can be paired with its complement, or if its complement is already in the set then two of the empty spaces can be filled by any other pair of complements not so far used. If n is odd then we fill the extra space with the centre number.

We can extend this result. If n is even and n/2 < k < n then k numbers can occur together in a uniform magic set provided they satisfy the inequalities: (nA − sum of the largest n−k numbers) £ (sum of the k numbers) £ (nA − sum of the smallest n−k numbers). Denoting the sum of the k numbers by Sk we require: (C+1)(2k−n)/2 + (n−k)(n−k+1)/2 £ Sk £ (C+1)n/2 − (n−k)(n−k+1)/2.

Thus for example, when C = 64 and n = 8 we have 196 £ S7 £ 259, 133 £ S6 £ 257, 71 £ S£ 254 (and 10 £ S4 £ 250, which is true for any four numbers). When C = 36 and n = 6 we have 75 £ S5 £ 110, 40 £ S4 £ 108. These conditions allow one to eliminate many random arrangements of numbers as being non-magic because they have too many large or small numbers together in the same set.

Since permuting the ranks or files, or transposing them to form a rectangle n×m, does not affect the uniform sums property it is possible to derive from any magic rectangle of size m×n a total of 2m!n! magic numberings. Some of these will be the rotations and reflections of the given array. These factorial products rapidly increase. For example on a 6×6 board, from one array we derive 2.6!.6! = 1,036,800 arrays, and we are already over the million mark. We must therefore be selective in the patterns we study.

From the 2m!n! permutations of a given numbered array we can choose a representative basic array by permuting the ranks and files so as to bring the smallest number to the top left corner, the next smallest number as close to that as possible, and so on. In a basic tour 1 is always in the corner and 2 a king move from it. A given basic array represents 2m!n!/8 standard forms.

Magic Rectangle Tours

In a rectangular magic tour C = mn and so T = mn(mn + 1)/2 and the magic constants are M = T/m = n(mn + 1)/2 and N = T/n = m(mn + 1)/2.

Theorem: A magic tour is impossible on a board that is odd by even. Proof: If the number of cells C = mn is even then mn + 1 is odd and so for the rank sum M = n(mn + 1)/2 to be a whole number n must be even, and similarly for the file sum N to be a whole number m must be even. On the other hand if mn is odd then both m and n must be odd, by simple arithmetic. This proves the case. Therefore the board must be odd×odd or even×even.

In the following tables it may be noted that any two adjacent numbers in one rank differ by the square of the rank number, since if N = m(mn + 1)/2 then increasing n by 2 gives the new sum N* = m[m(n + 2) + 1]/2 = N + m2. And similarly, increasing m by 2 changes M to M + n2.

Magic constants for odd-sided rectangles m×n (m £ n):
n \ m 3 5 7 9 11 13 15 17 19 21 23 25
3 15 24 33 42 51 60 69 78 87 96 105 114
5 40 65 90 115 140 165 190 215 240 265 290 315
7 77 126 175 224 273 322 371 420 469 518 567 616
9 126 207 288 369 450 531 612 693 774 855 936 1,017
11 187 308 429 550 671 792 913 1,034 1,155 1,276 1,397 1,518
13 260 429 598 767 936 1,105 1,274 1,443 1,612 1,781 1,950 2,119
15 345 570 795 1,020 1,245 1,470 1,695 1,920 2,145 2,370 2,595 2,820
17 442 731 1,020 1,309 1,598 1,887 2,176 2,465 2,745 3,043 3,332 3,621
19 551 912 1,273 1,634 1,995 2,356 2,717 3,078 3,439 3,800 4,161 4,522
21 672 1,113 1,554 1,995 2,436 2,877 3,318 3,759 4,200 4,641 5,082 5,523
23 805 1,334 1,863 2,392 2,921 3,450 3,979 4,508 5,037 5,566 6,095 6,624
25 950 1,575 2,200 2,825 3,450 4,075 4,700 5,325 5,950 6,575 7,200 7,825

The numbers below the diagonal are the rank sums those above are the file sums.

Magic constants for even-sided rectangles m×n (m £ n):
n / m 2 4 6 8 10 12 14 16 18 20 22 24
2 5 9 13 17 21 25 29 33 37 41 45 49
4 18 34 50 66 82 98 114 130 146 162 178 194
6 39 75 111 147 183 219 252 291 324 363 399 435
8 68 132 196 260 324 388 448 516 580 644 708 772
10 105 205 305 405 505 605 705 805 905 1,005 1,205 1,305
12 150 294 438 582 726 870 1,014 1,158 1,302 1,446 1,590 1,734
14 203 399 588 784 987 1,183 1,379 1,575 1,764 1,967 2,163 2,359
16 264 520 776 1,032 1,288 1,544 1,800 2,056 2,312 2,568 2,824 3,080
18 333 657 972 1,305 1,629 1,953 2,268 2,601 2,925 3,249 3,573 3,897
20 410 810 1,210 1,610 2,010 2,410 2,810 3,210 3,610 4,010 4,410 4,810
22 495 979 1,463 1,947 2,431 2,915 3,399 3,883 4,367 4,851 5,335 5,819
24 588 1,164 1,740 2,316 2,892 3,468 4,044 4,620 5,196 5,772 6,348 6,924

The numbers below the diagonal are the rank sums those above are the file sums.

Theorem: Every rectangular magic tour crosses its own path at least once. Proof: Let a < b < c < d be the four numbers in the corner cells of the board. If a and b are in opposite corners then so are c and d, and therefore the section a—b crosses the section c—d (as in diagram A). If a and b are in adjacent corners than so are c and d (as in diagrams B or C). If there is no crossover then all numbers in the edge a—b will be less than or equal to b and all numbers in the edge c—>d will be greater than or equal to c; therefore the sums of these two lines cannot be equal, and the tour cannot be magic, contrary to hypothesis. This proves the case.

Conjecture: Every rectangular magic tour crosses its own path at least twice. I think this is true but have not found a proof. The 2×4 king tour shown below is an example of a magic tour with exactly two crossovers. [The above proof and conjecture was published in The Journal of Recreational Mathematics (vol.28, issue 1, 1996-7, pp.77-78).]

Corollary: A magic wazir tour is not possible on any rectangle, since it cannot cross its own path. Semi-magic tours without crossvers are however possible (see the note on axial symmetry below).

Magic tours 2×n

On the 2×4 board there is one basic form and 2.2!.4!/8 =12 standard forms, as follows. One, the basic pattern, is a king tour, three are emperor tours (wazir + knight), the others use more than two types of move. All are symmetric about the horizontal axis. Four (when closed) are symmetric about the vertical axis (those in the first two columns here). For clarity the {0,2} and {0,3} moves are curved.

On the 2×6 board there is also only one basic tour form, it gives 2.2!6!/8 = 360 standard forms, but in this case the basic tour is surprisingly the only two-pattern leaper solution, namely a king tour. On the 2×8 board there are four basic (king) tours, and 20 other magic two-pattern leaper tours.

The two-pattern leapers occurring are 4 tours by {0,1}+{1,1} = King, 11 tours by {0,1}+{1,2} = Emperor, 8 tours by {0,1}+{1,4}, 1 tour by {0,1}+{1,5}.

On the 2×10 board there are 10 basic forms. They are diagrammed in the separate Note on King and Queen tours.

Magic tours 3×n

As noted above there are eight magic sets for n = 3 and they are all used in the ranks, files and diagonals of the 3×3 diagonally magic square. This is a feature of completeness that is not possessed by magic squares of larger sizes. The sets are of course: (1,5,9) (1,6,8) (2,4,9) (2,5,8) (2,6,7) (3,4,8) (3,5,7) (4,5,6).

Its 2.3!.3!/8 = 9 standard forms each have a different number in the centre cell. The "basic" tour on our scheme is the one with 2 in the centre. However it is the one with 5 in the centre that has the distinctive properties: it is centrosymmetric and diagonally magic and uses only three types of leap, so it is a {0,1}+{1,1}+{1,2} = centaur tour. According to historians of mathematics this magic square was known in China from 2200 BC, and according to Pavle Bidev [1986, part 2, p.34] an Arabic encyclopaedia edited at Basra in year 898 by members of the philosophical association 'Brothers of Sincerity' describes the method of constructing the 3×3 magic square by moves of knight, fers and pawn.

On the 3×5 board I found 39 basic numberings, each of these giving rise to 2.3!.5!/8 = 180 standard forms, making 39#times;180 = 7020 magic tours in all. In an analysis reported in Chessics #25 I found four symmetric 3×5 magic tours, but they use four to six different kinds of move.

Much of the material above was first published in the special issue of Chessics on Magic Tours (#25, Summer 1986).

Magic Squares

In the case of a square m = n and so M = N, and we have a magic square. For a magic square tour n×n the magic constant is n(n2 + 1)/2.

A popular extra condition on a magic square is that the two diagonals shall also sum to the magic constant, we then call it a diagonal magic square. [Note however that in older literature on magic squares the diagonal condition is often taken for granted. A non-diagonal magic square is then sometimes misleadingly termed "semi-magic".] It is also possible in some cases for the broken diagonals, which can be converted into long diagonals by a circular permutation of the ranks or files, also add to the constant, we then have a pandiagonal magic square [other terms such as "diabolic" or "nasik" are also used].

Another interesting extra condition on a magic array is that it have a form of supersymmetry. For example a 7×7 square can have H-supersymmetry, where certain areas of 7 cells in the shape of an H (upright or rotated) add to the magic constant.

Magic constants for squares:

tens/unit 0 1 2 3 4 5 6 7 8 9
0 0 1 5 15 34 65 111 175 260 369
1 505 671 870 1,105 1,379 1,695 2,056 2,465 2,925 3,439
2 4,010 4,641 5,335 6,095 6,924 7,825 8,801 8,855 10,990 12,209
3 13,515 14,911 16,400 17,985 19,669 21,455 23,346 25,345 27,455 29,679
4 32,020 34,481 37,065 39,775 42,614 45,585 48,691 51,935 55,320 58,849

Magic Square Tours 4×4

This study has been extended and is now on a separate page.

Natural Magic

Some magic squares can be constructed by a simple transformation of the natural numbering. The simplest examples are semi-natural magic squares which have half their numbers in natural order and half in the reverse of natural order.

In 1997 I was sent copies of a magazine Irregular News by Ricardo Calvo, published in Madrid. Issue 6 contained diagrams of two 8×8 diagonal magic squares named the 'Safadi' and 'Mercury' squares, shown below (reoriented with the 1 at the top left corner). After studying these I found that there is a third diagonal magic square of this type, the 'Intermediate'. (Can anyone tell me if this magic square also has a name and a history? Since magic squares have been worked on for centuries I don't expect it is an original result.)

1 2 62 61 60 59 7 8
9 10 54 53 52 51 15 16
48 49 19 20 21 22 42 41
40 39 27 28 29 30 34 33
32 31 35 36 37 38 26 25
24 23 43 44 45 46 18 17
49 50 14 13 12 11 55 56
57 58 6 5 4 3 63 64
1 63 3 61 60 6 58 8
56 10 54 12 13 51 15 49
17 47 19 45 44 22 42 24
40 26 38 28 29 35 31 33
32 34 30 36 37 27 39 25
41 23 43 21 20 46 18 48
16 50 14 52 53 11 55 9
57 7 59 5 4 62 2 64
1 63 62 4 5 59 58 8
56 10 11 53 52 14 15 49
48 18 19 45 44 22 23 41
25 39 38 28 29 35 34 32
33 31 30 36 37 27 26 40
24 42 43 21 20 46 47 17
16 50 51 13 12 54 55 9
57 7 6 60 61 3 2 64

The following are the patterns of the squares occupied by the moved and unmoved numbers:

The Mercury magic square occurs as Figs.53 and 91 and the Safadi square as Fig.94 in W. S. Andrews Magic Squares and Cubes 1917, though not under those names.

A diagonal magic square similar to the Intermediate square, in that the ranks and files contain the same sets of numbers, though arranged in a different sequence, is given in The Oxford Companion to Chess (1984, p.199) by D. Hooper and K. Whyld. (It seems to have been taken from the works of Pavle Bidev, who in turn ascribes it to H. J. Kesson, 1881.) In the Safadi the quarters are chequered boards, in the Mercury the sixteenths (i.e. the 2×2 blocks) are chequered; the Intermediate has both these properties.

[The above item appeared in The Games and Puzzles Journal (#15, p.252, 1997).]

Structures of Some Magic Tours

Cyclic Magic Tours

Renumbering a tour 1, 2, ..., C cyclically from the cell numbered q+1 (so that q+1 becomes 1, q+2 becomes 2, ..., C becomes C−q, 1 becomes C−q+1, ... and finally q becomes C) has the effect of increasing q cells by C−q and of decreasing C−q cells by q. Thus if there are i increases in any given magic set of n entries there are n−i decreases and the sum of the magic set is increased by i(C−q) and decreased by (n−i)q. If the magic sum is to be unaltered we must have these two values equal. This implies iC = nq, so i = nq/C. This shows that i is independent of the particular magic n-set considered. The number of increases must be the same in every magic n-set if the tour is to remain magic. We call such a tour a cyclic magic tour.

In a magic rectangle tour C = mn and so q = iC/n = im, i.e. q, the origin of renumbering, must be a multiple of m. If we are to preserve the file-magic property as well as the rank-magic then the number j of increases in each file must be the same and q = jn. Thus q must be a multiple of both m and n, and thus of lcm(m, n). The cells numbered 1, 2, ..., q in the original tour must therefore be arranged with i in each rank and j in each file, i.e. they form an (i, j)-satin. For a square of course m = n and i = j and q is a multiple of n.

In the case of a centrosymmetric closed tour of an even board, renumbering from the half-way mark (mn/2 + 1) gives a 180° rotation of the tour. It follows that in a magic rectangle tour of this type the numbers 1, 2, ..., mn/2 form an (m/2, n/2)-satin and m and n must both be even. In particular in the square case the numbers 1, 2, ..., n/2 must form an n/2-satin.

Kraitchik provided a test to determine whether an 8×8 closed knight's tour could be made magic by renumbering from some point. Generalised to tours of any kind and size this is: (a) Add up the first column, giving a figure S', (b) Take the sum with the magic constant (S' + N). (c) This must be divisible by n to give (S' + N)/n. (d) Express this number in the form mi + X for various values of X, starting from the remainder x when (S' + N)/n is divided by m and proceeding to x + m, x + 2m, and so on. (e) If i expresses the number of increases relative to C in the given column then renumbering from X will change the column total to N.

The Method of Axial Symmetry

In the case of an axisymmetric open tour of a rectangular board 2m×n, the axis bisecting the side 2m, the numbers in each line of 2m will add to the same total, namely m(C+1), since each such line consists of m complementary pairs, h being symmetric to C+1−h. The middle move C/2 to C/2+1 must cross the axis at right angles, and must therefore be a rook move.

The Kashmirian poet Rudrata (c.900) gave verses representing a simple boustrophedonal rook tour and a sawtooth-pattern elephant tour on the 4×8 board which are axisymmetric, and thus semi-magic, though this property may not have been realised by the composer. He also gave a knight tour but that of course could not have axial symmetry.

The elephant, which is a piece still in use in Burmese and Thai forms of chess and was described by al-Beruni as used in India, moves one step diagonally with the extra power of a single pawn-like forward step (the five moves thus representing the elephant's four legs and trunk). I have shown the form of tour proposed by Murray, rather than that given in the commentary by Jacobi which has 17 at the start of the third row down so that 16-17 is not an elephant move. This also ensures that, like the rook tour, the files are magic (all add to 66), being formed of pairs of complements adding to 33.

Consider now a closed doubly-axisymmetric tour which gives an open axisymmetric tour when the link C to 1 is removed, and also when the link C/4 to C/4 + 1 is removed, the first having a horizontal axis and the second a vertical axis. The files will be magic, but what about the ranks? If the tour is renumbered, to start with 1 at C/4 + 1 and C at C/4, then the ranks will be magic, but reverting to the original numbering increases all the entries 1, .., 3C/4 by C/4 and decreases the entries in the other quarter of the tour by 3C/4. Thus for the magic property of the ranks to be retained each rank must contain three entries from the increased quarters for each entry from the decreased quarter. It follows that the cells used by each quarter must have n/4 entries in every rank, so n must be divisible by 4. This type of double axisymmetric construction is thus possible on boards of sizes 2h×4k.

It also follows from this construction that in the case of a square board the sum of the two diagonals will be twice the magic constant, because if k (in the range 1 to C/4) is on a diagonal then so are 3C/4 + 1 −k and C/2 + 1 − k and k + C/4 which add to 2C + 2.

Method of Ranges

More general arrays which have the constant sum property but in which the numbers are not all be different may be termed mystic arrays. In some cases it is possible to tell that the array is mystic without needing to add up the numbers, since we can see that each subarray consists of the same numbers in some order.

If fg = C then the numbers 1, 2, ..., C form g ranges each of f terms: (1, ..., f) (f+1, ..., 2f) (2f+1, ..., 3f) ... ((g−1)f+1, ..., gf). Each entry, say e, can be expressed uniquely in the form e = fa + b indicating that it is the bth element in the (a+1)th range. Thus b takes the values 1, 2, ..., f and a the values 0, 1, ..., (g−1).

If the numbers in a magic rectangle tour are expressed in this fashion then the rectangle as a whole can be expressed in a similar fashion as E = fA + B. For example Dürer's magic square of 1514 gives:

    16  3  2 13          3  0  0  3     4  3  2  1  
     5 10 11  8  =  4 x  1  2  2  1  +  1  2  3  4  
     9  6  7 12          2  1  1  2     1  2  3  4  
     4 15 14  1          0  3  3  0     4  3  2  1  

And each component square A and B is mystic. In the case of magic knight tours of the 8×8 chessboard it will be found that many of them can be analysed in this fashion with f = 4, and that A consists of four 4×4 latin squares. In this case the ranges are known as "quartes".

Back to top