Mathematical Recreations and Essays
A doubly-even square is one where is of the form . If the square is divided into four equal quarters, the first quarter will contain columns and rows. In each of these columns take cells so arranged that there are also cells in each row, and change the numbers in these cells and the cells associated with them by a cross interchange. The result is equivalent to interchanges in every row and in every column, and therefore renders the square magic.
One way of selecting the cells in the first quarter is to divide the whole square into sixteen subsidiary squares each containing cells, which we may represent by the diagram below, and then we may take either the cells in the squares or those in the squares; thus, if every number in the eight squares is interchanged with the number
skewly related to it the resulting square is magic. A magic square of the eighth order, constructed in this way, is shown in figure xv on page 138.
Another way of selecting the cells in the first quarter would be to take the first cells in the first column, the cells 2 to in the second column, and so on, the cells to in the th column, the cells to and the first cell in the th column, and so on, and finally the th cell and the cells 1 to in the th column.
A singly-even square is one where is of the form . If the square is divided into four equal quarters, the first quarter will contain columns and rows. In each of these columns take cells so arranged that there are also cells in each row: as, for instance, by taking the first cells in the first column, the cells 2 to in the second column, and so on, the cells to in the th column, the cells to and the first cell in the th column, and so on, and finally the th cell and the cells 1 to in the th column. Next change the numbers in these cells and the cells associated with them by cross interchanges. The result is equivalent to interchanges in every row and in every column. In order to make the square magic we must have , that is, such interchanges in every row and in every column, that is, we must have one more interchange in every row and in every column. This presents no difficulty, for instance, in the arrangement indicated above the numbers in the th cell of the first column, in the first cell of the second column, in the second cell of the third column, and so on, to the th cell in the th column may be interchanged with the numbers in their vertically related cells; this will make all the rows magic. Next, the numbers in the th cell of the first column, in the th cell of the second column, in the first cell of the third column, in the second cell of the fourth column, and so on, to the th cell of the th column may be interchanged with those in the cells horizontally related to them; and this will make the
columns magic without affecting the magical properties of the rows.
It will be observed that we have implicitly assumed that is not zero, that is, that is greater than 2; also it would seem that, if and therefore , then the numbers in the diagonal cells must be included in those to which the cross interchange is applied, but, if , this is not necessary, though it may be convenient.
The construction of odd magic squares and of doubly-even magic squares is very easy. But though the rule given above for singly-even squares is not difficult, it is tedious of application. It is unfortunate that no more obvious rule—such, for instance, as one for bordering a doubly-even square—can be suggested for writing down instantly and without thought singly-even magic squares.
De la Hire’s Method. I now proceed to give another way due to De la Hire, of constructing any even magic square of an order higher than two.
In the same manner as in his rule for making odd magic squares, we begin by constructing two subsidiary squares, one of the unit-digits, , and the other of the radix-digits . We then form the magic square by adding together the numbers in the corresponding cells in the two subsidiary squares. Following the analogy of the notation used above, two numbers which are equidistant from the ends of the series are said to be complementary. Similarly numbers which are equidistant from the ends of the series are said to be complementary.
For simplicity I shall apply this method to construct a magic square of only the sixth order, though an exactly similar method will apply to any even square of an order higher than the second.
The first of the subsidiary squares (figure ix) is constructed as follows. First, the cells in the leading diagonal are filled with the numbers 1, 2, 3, 4, 5, 6 placed in any order whatever that puts complementary numbers in complementary positions (ex. gr. in the order 2, 6, 3, 4, 1, 5, or in their natural order 1, 2, 3, 4, 5, 6). Second, the cells vertically related to these are filled respectively with the same numbers. Third, each of the remaining cells in the first vertical column is filled
- The rule is due to De la Hire (part 2 of his memoir) and is given by Montucla in his edition of Ozanam’s work: I have used the modified enunciation of it inserted in Labosne’s edition of Bachet’s Problèmes, as it saves the introduction of a third subsidiary square. I do not know to whom the modification is due.
either with the same number as that already in two of them or with the complementary number (ex. gr. in figure ix with a “1” or a “6”) in any way, provided that there are an equal number of each of these numbers in the column, and subject also to the provisoes mentioned in the next paragraph but one. Fourth, the cells horizontally related to those in the first column are filled with the complementary numbers. Fifth, the remaining cells in the second and third columns are filled in an analogous way to that in which those in the first column were filled: and then the cells horizontally related to them are filled with the complementary numbers. The square so formed is necessarily magic in rows, columns, and diagonals.
The second of the subsidiary squares (figure x) is constructed as follows. First, the cells in the leading diagonal are filled with the numbers 0, 6, 12, 18, 24, 30 placed in any order whatever that puts complementary numbers in complementary positions. Second, the cells horizontally related to them are filled respectively with the same numbers. Third, each of the remaining cells in the first horizontal row is filled either with the same number as that already in two of them or with the complementary number (ex. gr. in figure x with a “0” or a “30”) in any way, provided (i) that there are an equal number of each of these numbers in the row, and (ii) that if any cell in the first row of figure ix and its vertically related cell are filled with complementary numbers, then the corresponding cell in the first row of figure x and its horizontally related cell must be occupied by the same number*. Fourth, the cells vertically related to those in the first row are filled with the complementary numbers. Fifth, the remaining cells in the second and
- The insertion of this step evades the necessity of constructing (as Montucla did) a third subsidiary square.
the third rows are filled in an analogous way to that in which those in the first row were filled: and then the cells vertically related to them are filled with the complementary numbers. The square so formed is necessarily magic in rows, columns, and diagonals.
It remains to show that proviso (ii) in the third step described in the last paragraph can be satisfied always. In a doubly even square, that is, one in which is divisible by 4, we need not have any complementary numbers in vertically related cells in the first subsidiary square unless we please, but even if we like to insert them they will not interfere with the satisfaction of this proviso. In the case of a singly even square, that is, one in which is divisible by 2, but not by 4, we cannot satisfy the proviso if any horizontal row in the first square has all its vertically related squares, other than the two squares in the diagonals, filled with complementary numbers. Thus in the case of a singly even square it will be necessary in constructing the first square to take care in the third step that in every row at least one cell which is not in a diagonal shall have its vertically related cell filled with the same number as itself: this is always possible if is greater than 2.
The required magic square will be constructed if in each cell we place the sum of the numbers in the corresponding cells of the subsidiary squares, figures ix and x. The result of this is given in figure xi. The square is evidently magic. Also every number from 1 to 36 occurs once and only once, for the numbers from 1 to 6 and from 31 to 36 can occur only in the top or the bottom rows, and the method of construction ensures that the same number cannot occur twice. Similarly the numbers from 7 to 12 and from 25 to 30 occupy two other rows, and no number can occur twice; and so on. The square in figure i on page 121 may be constructed by the above rules; and the reader will have no difficulty in applying them to any other even square.
OTHER METHODS FOR CONSTRUCTING ANY MAGIC SQUARE.
The above methods appear to me to be the simplest which have been proposed. There are however two other methods, of less generality, to which I will allude briefly in passing. Both depend on the principle that, if every number in a magic square is multiplied by some constant, and a constant is added to the product, the square will remain magic.
The first method applies only to such squares as can be divided into smaller magic squares of some order higher than two. It depends on the fact that, if we know how to construct magic squares of the th and th