PG26839.B00147
[PDF page 146] 130 MAGIC SQUARES. [CH. V The sum of the numbers originally in theyth column from the left-hand side is N − 1 2 n(n − 2y + 1). The sum of the numbers originally in the complementary column, that is, the yth column from the right-hand side, is N + 1 2 n(n − 2y + 1). Also the number originally in any cell in the yth column was less than the number in the cell horizontally related to it byn −2y +1. Hence, if in these two columns we had made 1 2 n interchanges of the numbers situated in horizontally related cells, we should have made the sum of the numbers in each column equal to N. If we had done this in succession for every pair of complementary columns, we should have made the square magic in columns. But, as before, in order that the diagonals might remain magic, either we must have left both the diagonal numbers in any column unaltered, or we must have changed both of them with those in the cells horizontally related to them. It remains to show that the vertical and horizontal interchanges, which have been considered in the last two paragraphs, can be made independently, that is, that we can make these interchanges of the numbers in complementary columns in such a manner as will not affect the numbers already interchanged in complementary rows. This will require that in every column there shall be exactly 1 2 n interchanges of the numbers in vertically related cells, and that in every row there shall be exactly 1 2 n interchanges of the numbers in horizontally related cells. I proceed to show how we can always ensure this, ifn is greater than 2. I continue to suppose that the cells are initially filled with the numbers1, 2, . . . , n2 in their natural order, and that we work from that arrangement. Adoubly-even squareis one wherenis of the form4m. If the square is divided into four equal quarters, the first quarter will contain2m columnsand 2mrows. Ineachofthesecolumnstake mcellssoarranged that there are alsom cells in each row, and change the numbers in these 2m2 cells and the6m2 cells associated with them by a cross interchange. The result is equivalent to2m interchanges in every row and in every column, and therefore renders the square magic. One way of selecting the2m2 cells in the first quarter is to divide the whole square into sixteen subsidiary squares each containingm2 cells, which we may represent by the diagram below, and then we may take either the cells in thea squares or those in theb squares; thus, if every number in the eighta squares is interchanged with the number

PG26839.B00148
[PDF page 147] CH. V] MAGIC SQUARES OF AN EVEN ORDER.. 131 a b b a b a a b b a a b a b b a 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 the2m2 cells in the first quarter would be to take the firstm cells in the first column, the cells2 to m + 1 in the second column, and so on, the cellsm + 1 to 2m in the (m + 1)th column, the cellsm+2 to 2m and the first cell in the(m+2)th column, and so on, and finally the2mth cell and the cells1 to m − 1 in the 2mth column. A singly-even squareis one wheren is of the form2(2m+1). If the square is divided into four equal quarters, the first quarter will contain 2m+1 columns and2m+1 rows. In each of these columns takem cells so arranged that there are alsom cells in each row: as, for instance, by taking the firstm cells in the first column, the cells2 to m + 1 in the second column, and so on, the cellsm + 2 to 2m + 1 in the (m + 2)th column, the cells m + 3 to 2m + 1 and the first cell in the(m + 3)th column, and so on, and finally the(2m + 1)th cell and the cells1 to m − 1 in the (2m + 1)th column. Next change the numbers in these m(2m+1) cells and the3m(2m+1) cells associated with them by cross interchanges. The result is equivalent to2m interchanges in every row and in every column. In order to make the square magic we must have 1 2 n, that is,2m+1 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(2m + 1)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 the2mth cell in the(2m + 1)th column may be interchanged with the numbers in their vertically related cells; this will make all the rows magic. Next, the numbers in the2mth cell of the first column, in the(2m + 1)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 (2m −1)th cell of the(2m+ 1)th column may be interchanged with those in the cells horizontally related to them; and this will make the

PG26839.B00149
[PDF page 148] 132 MAGIC SQUARES. [CH. V columns magic without affecting the magical properties of the rows. It will be observed that we have implicitly assumed thatm is not zero, that is, thatn is greater than 2; also it would seem that, ifm = 1 and therefore n = 6, then the numbers in the diagonal cells must be includedinthosetowhichthecrossinterchangeisapplied, but, if n > 6, 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, 1, 2, 3, . . . , n, and the other of the radix-digits 0, n,2n, . . . ,(n − 1)n. 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 series1, 2, 3, . . . , nare said to becomplementary. Similarly numbers which are equidistant from the ends of the series 0, n,2n, . . . ,(n − 1)n are said to becomplementary. 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 fol- lows. 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 order1, 2, 3, 4, 5, 6). Second, the cells ver- tically 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’sProblèmes, as it saves the introduction of a third subsidiary square. I do not know to whom the modification is due.

PG26839.B00150
[PDF page 149] CH. V] MAGIC SQUARES OF AN EVEN ORDER.. 133 1 5 4 3 2 6 6 2 4 3 5 1 6 5 3 4 2 1 1 5 3 4 2 6 6 2 3 4 5 1 1 2 4 3 5 6 First Subsidiary Square Figure ix. 0 30 30 0 30 0 24 6 24 24 6 6 18 18 12 12 12 18 12 12 18 18 18 12 6 24 6 6 24 24 30 0 0 30 0 30 Second Subsidiary Square Figure x. 1 35 34 3 32 6 30 8 28 27 11 7 24 23 15 16 14 19 13 17 21 22 20 18 12 26 9 10 29 25 31 2 4 33 5 36 Resulting Magic Square Figure xi. 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 fol- lows. 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 comple- mentary numbers in complementary positions. Second, the cells hori- zontally 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 hori- zontally 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.

PG26839.B00151
[PDF page 150] 134 MAGIC SQUARES. [CH. V 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. Itremainstoshowthatproviso(ii)inthethirdstepdescribedinthe last paragraph can be satisfied always. In a doubly even square, that is, one in whichn is divisible by4, 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 whichn is divisible by2, but not by4, 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 ifn 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 sub- sidiary squares, figures ix and x. The result of this is given in figure xi. The square is evidently magic. Also every number from1 to 36 occurs once and only once, for the numbers from1 to 6 and from31 to 36 can occur only in the top or the bottom rows, and the method of construc- tion 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 howevertwo 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 methodapplies 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 themth andnth

PG26839.B00152
[PDF page 151] CH. V] COMPOSITE AND BORDERED SQUARES.. 135 orders, we can construct one of themnth order. For example, a square of 81 cells may be considered as composed of9 smaller squares each containing 9 cells, and by filling the cells in each of these small squares in the same relative order and taking the small squares themselves in the same order, the square can be constructed easily. Such squares are called composite magic squares. The second method, which was introduced by Frénicle, consists in surrounding a magic square with aborder. Thus in figure xii on the following page the inner square is magic, and it is surrounded with a border in such a way that the whole square is also magic. In this manner from the magic square of the3rd order we can build up suc- cessively squares of the orders 5, 7, 9, &c., that is, any odd magic square. Similarly from the magic square of the4th order we can build up successively any higher even magic square. If we construct a magic square of the firstn2 numbers by bordering a magic square of(n − 2)2 numbers, the usual process is to reserve for the 4(n − 1) numbers in the border the first2(n − 1) natural numbers and the last2(n − 1) numbers. Now the sum of the numbers in each line of a square of the order(n − 2) is 1 2(n − 2){(n − 2)2 + 1}, and the average is 1 2 {(n − 2)2 + 1}. Similarly the average number in a square of the nth order is1 2(n2 +1). The difference of these is2(n −1). We begin then by taking any magic square of the order(n − 2), and we add to every number in it2(n − 1); this makes the average number1 2(n2 + 1). The numbers reserved for the border occur in pairs,n2 and 1, n2 −1 and 2, n2 −2 and 3, &c., such that the average of each pair is1 2(n2 +1), and they must be bordered on the square so that these numbers are opposite to one another. Thus the bordered square will be necessarily magic, provided that the sum of the numbers in two adjacent sides of the external border is correct. The arrangement of the numbers in the borders will be somewhat facilitated if the numbern2 + 1 − p (which has to be placed opposite to the numberp) is denoted byp, but it is not worth while going into further details here. It will illustrate sufficiently the general method if I explain how the square in figure xii is constructed. A magic square of the third order is formed by De la Loubère’s rule, and to every number in it8 is added: the result is the inner square in figure xii. The numbers not used are 25 and 1, 24 and 2, 23 and 3, 22 and 4, 21 and 5, 20 and 6, 19 and 7, 18 and 8. The sum of each pair is26, and obviously they must be

PG26839.B00153
[PDF page 152] 136 MAGIC SQUARES. [CH. V placed at opposite ends of any line. I believe that with a little patience a magic square of any order can be thus built up, and of course it will have the property that, if each border is successively stripped off, the square will still remain magic. Some examples are given by Violle. This is the method of construction commonly adopted by self-taught mathematicians, many 1 2 19 20 23 18 16 9 14 8 21 11 13 15 5 22 12 17 10 4 3 24 7 6 25 Bordered Magic Square. Figure xii. 7 20 3 11 24 13 21 9 17 5 19 2 15 23 6 25 8 16 4 12 1 14 22 10 18 Nasik Magic Square. Figure xiii. of whom seem to think that the empirical formation of such squares is a valuable discovery. There are magic circles, rectangles, crosses, diamonds, stars, and other figures: also magic cubes, cylinders, and spheres. The theory of the construction of such figures is of no value, and I cannot spare the space to describe rules for forming them. Hyper-Magic Squares. In recent times attention has been mainly concentrated on the formation of magic squares with the impo- sition of additional conditions; some of the resulting problems involve mathematical difficulties of a high order. Nasik Squares. In one species of hyper-magic squares the squares are formed so that the sums of the numbers along all the rows and columns, both diagonals, and all the broken diagonals are the same. In England these are callednasik squaresor pan-diagonal magic squares: in Francecarrés diaboliques or carrés magiquement magiques. These squares were mentioned by De la Hire, Sauveur, and Euler; but the theory is mainly due to Mr A.H. Frost, who has expounded it in the memoirs mentioned in the footnote on page 123, and to M. Frolow, who treated it in two memoirs, St Petersburg, 1884, and Paris, 1886. Of course a nasik square can be divided by a vertical or horizontal cut and the pieces interchanged without affecting the magical property. By

PG26839.B00154
[PDF page 153] CH. V] MAGIC PENCILS. 137 one vertical and one horizontal transposition of this kind any number can be moved to any specified cell. A nasik square of the fourth order is represented in figure ii on page 121, and one of the fifth order is represented in figure xiii on the preceding page. Nasik squares of the order6n±1 can be constructed by rules analogous to those given by De la Loubère, except that a knight’s and not a bishop’s move must be used in connecting cells filled by consecutive numbers and that for orders higher than five special rules for going from the cell occupied by the numberkn to that occupied by the number kn + 1 have to be laid down. Doubly-Magic Squares. In another species of hyper-magic squares the problem is to construct a magic square of thenth order in such a way that if the number in each cell is replaced by itsmth power the 5 31 35 60 57 34 8 30 19 9 53 46 47 56 18 12 16 22 42 39 52 61 27 1 63 37 25 24 3 14 44 50 26 4 64 49 38 43 13 23 41 51 15 2 21 28 62 40 54 48 20 11 10 17 55 45 36 58 6 29 32 7 33 59 A Doubly-Magic Square. Figure xiv. resulting square shall also be magic. Here for example (see figure xiv) is a magic square* of the eighth order, the sum of the numbers in each line being equal to260, so constructed that if the number in each cell is replaced by its square the resulting square is also magic (the sum of the numbers in each line being equal to11180). Magic Pencils. Hitherto I have concerned myself with num- bers arranged in lines. By reciprocating the figures composed of the * See M. Coccoz in L’Illustration, May 29, 1897.

PG26839.B00155
[PDF page 154] 138 MAGIC SQUARES. [CH. V points on which the numbers are placed we obtain a collection of lines forming pencils, and, if these lines be numbered to correspond with the points, the pencils will be magic*. Thus, in a magic square of thenth order, we arrange n2 consecutive numbers to form2n + 2 lines, each containing n numbers so that the sum of the numbers in each line is the same. Reciprocally we can arrangen2 lines, numbered consecutively to form 2n + 2 pencils, each containingn lines, so that in each pencil the sum of the numbers designating the lines is the same. For instance, figure xv represents a magic square of64 consecutive 1 2 62 61 60 59 7 8 9 10 54 53 52 51 15 16 48 47 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 Figure xv. numbers arranged to form 18 lines, each of 8 numbers. Reciprocally, figure xvi represents 64 lines arranged to form 18 pencils, each of 8 lines. The method of construction is fairly obvious. The eight-rayed pencil, vertex O, is cut by two parallels perpendicular to the axis of the pencil, and all the points of intersection are joined cross-wise. This gives 8 pencils, with vertices A, B, . . . , H; 8 pencils, with vertices A′, . . . H′; one pencil with its vertex atO; and one pencil with its vertex on the axis of the last-named pencil. The sum of the numbers in each of the 18 lines in figure xv is the same. To make figure xvi correspond to this we must number the lines in the pencilA from left to right,1, 9, . . . ,57, following the order of the numbers in the first column of the square: the lines in pencilB must be numbered similarly to correspond to the numbers in the second column of the square, and so on. To prevent confusion in the figure I * See Magic-Reciprocalsby G. Frankenstein, Cincinnati, 1875.

PG26839.B00156
[PDF page 155] CH. V] MAGIC PENCILS. 139 O AB C DEF G H A' H' Figure xvi. have not inserted the numbers, but it will be seen that the method of construction ensures that the sum of the 8 numbers which designate the lines in each of these 18 pencils is the same. We can proceed a step further, if the resulting figure is cut by two other parallel lines perpendicular to the axis, and if the points of their intersection with the cross-joins be joined cross-wise, these new cross-joins will intersect on the axis of the original pencil or on lines

PG26839.B00157
[PDF page 156] 140 MAGIC SQUARES. [CH. V perpendicular to it. The whole figure will now give83 lines, arranged in 244 pencils each of8 rays, and will be the reciprocal of a magic cube of the 8th order. If we reciprocate back again we obtain a representation in a plane of a magic cube. Magic Square Puzzles. Many empirical problems, closely re- lated to magic squares, will suggest themselves; but most of them are more correctly described as ingenious puzzles than as mathematical recreations. The following will serve as specimens. Magic Card Square*. The first of these is the familiar problem of placing the sixteen court cards (taken out of a pack) in the form of a square so that no row, no column, and neither of the diagonals shall contain more than one card of each suit and one card of each rank. The solution presents no difficulty, and is indicated in figure xviii on the next page. Euler’s Officers Problem†. A similar problem, proposed by Euler in 1779, consists in arranging, if it be possible, thirty-six officers taken from six regiments—the officers being in six groups, each consisting of six officers of equal rank, one drawn from each regiment; say officers of rank a, b, c, d, e, f, drawn from the1st, 2nd, 3rd, 4th, 5th, and 6th regiments—in a solid square formation of six by six, so that each row and each file shall contain one and only one officer of each rank and one and only one officer from each regiment. The problem is insoluble. Extension of Euler’s Problem.More generally we may investigate the arrangement on a chess-board, containingn2 cells, of n2 counters (the counters being divided inton groups, each group consisting ofn counters of the same colour numbered consecutively1, 2, . . . , n) so that each row and each column shall contain no two counters of the same colour or marked with the same number. For instance, if n = 3, with three red counters a1, a2, a3, three white counters b1, b 2, b3, and three black countersc1, c2, c3, we can satisfy the conditions by arranging them as in figure xvii on the facing page. If n = 4, then with countersa1, a2, a3, a4; b1, b2, b3, b4; c1, c2, * Ozanam, 1723 edition, vol. iv, p. 434. † Euler’sCommentationes Arithmeticae, St Petersburg, 1849, volii, pp. 302–361. See also a paper by G. Tarry in theComptes rendusof the French Association for the Advancement of Science, Paris, 1900, vol.ii, pp. 170–203; and various notes in L’Intermédiaire des mathématiciens, Paris, vol. iii, 1896, pp. 17, 90; vol. v, 1898, pp. 83, 176, 252, vol.vi, 1899, p. 251; vol.vii, 1900, pp. 14, 311.

PG26839.B00158
[PDF page 157] CH. V] MAGIC PUZZLES.. 141 c3, c4; d1, d2, d3, d4, we can arrange them as in figure xviii below. A solution when n = 5 is indicated in figure xix. a1 b2 c3 b2 c1 a2 c3 a3 b1 Figure xvii. a1 b2 c3 d4 c4 d3 a2 b1 d2 c1 b4 a3 b3 a4 d1 c2 Figure xviii. a1 b2 c3 d4 e5 b5 c1 d2 e3 a4 c4 d5 e1 a2 b3 d3 e4 a5 b1 c2 e2 a3 b4 c5 d1 Figure xix. The problem is soluble if n is odd or if n is of the form 4m. If solutions when n = a and when n = b are known, a solution when n = ab can be written down at once. The theory is closely connected with that of magic squares and need not be here discussed further. Magic Domino Squares. Analogous problems can be made with dominoes. An ordinary set of dominoes, ranging from double zero to double six, contains28 dominoes. Each domino is a rectangle formed by fixing two small square blocks together side by side: of these56 blocks, eight are blank, on each of eight of them is one pip, on each of another eight of them are two pips, and so on. It is required to arrange the dominoes so that the56 blocks form a square of7 by 7 bordered by one line of7 blank squares and so that the sum of the pips in each row, each column, and in the two diagonals of the square is equal to 24. A solution* is given on the following page. Similarly, a set of dominoes, ranging from double zero to doublen, contains 1 2(n + 1)(n + 2)dominoes and therefore(n + 1)(n + 2)blocks. Can these dominoes be arranged in the form of a square of(n + 1)2 cells, bordered by a row of blanks, so that the sum of the pips in each row, each column, and in the two diagonals of the square is equal to 1 2 n(n + 2)? Magic Coin Squares†. There are somewhat similar questions con- cerned with coins. Here is one applicable to a square of the third order divided into nine cells, as in figure xvii above. If a five-shilling piece is placed in the middle cellc1 and a florin in the cell below it, namely, in a3 it is required to place the fewest possible current English coins in * See L’Illustration, July 10, 1897. † See The Strand Magazine, London, December, 1896, pp. 720, 721.

PG26839.B00159
[PDF page 158] 142 MAGIC SQUARES. [CH. V Magic Domino Square. the remaining seven cells so that in each cell there is at least one coin, so that the total value of the coins in every cell is different, and so that the sum of the values of the coins in each row, column, and diagonal is fifteen shillings: it will be found that thirteen additional coins will suf- fice. A similar problem is to place ten current English postage stamps, all but two being different, in the nine cells so that the sum of the values of the stamps in each row, column, and diagonal is ninepence.
