Mathematical Recreations and Essays · W. W. Rouse Ball

Chapter V: Magic Squares

7 of 16 · 42 min of reading

A magic square consists of a number of integers arranged in the form of a square, so that the sum of the numbers in every row, in every column, and in each diagonal is the same. If the integers are the consecutive numbers from 1 to n^2 the square is said to be of the n th order, and it is easily seen that in this case the sum of the numbers in any row, column, or diagonal is equal to 1/2n(n^2 +1) : this number may be denoted by N. I confine my account to such magic squares, that is, to squares formed with consecutive integers, from 1 upwards.

Thus the first 16 integers, arranged in either of the forms given in figures i and ii below, form a magic square of the

fourth order, the sum of the numbers in any row, column, or diagonal being 34. Similarly figures iii and v on page , figure viii on page , and figures xii and xiii on page , show magic squares of the fifth order; and figure xi on page shows a magic square of the sixth order; and figures xiv and xv on pages , , show magic squares of the eighth order.

Notes on the History of Magic Squares The formation of these squares is an old amusement, and

in times when mystical philosophical ideas were associated with particular numbers it was natural that such arrangements should be deemed to possess magical properties. Magic squares of an odd order were constructed in India before the Christian era according to a law of formation which is explained hereafter. Their introduction into Europe appears to have been due to Moschopulus, who lived at Constantinople in the early part of the fifteenth century, and enunciated two methods for making such squares. The majority of the medieval astrologers and physicians were much impressed by such arrangements. In particular the famous Cornelius Agrippa (1486--1535) constructed magic squares of the orders 3 , 4 , 5 , 6 , 7 , 8 , 9 , which were associated respectively with the seven astrological "planets": namely, Saturn, Jupiter, Mars, the Sun, Venus, Mercury, and the Moon. He taught that a square of one cell, in which unity was inserted, represented the unity and eternity of God; while the fact that a square of the second order could not be constructed illustrated the imperfection of the four elements, air, earth, fire, and water; and later writers added that it was symbolic of original sin. A magic square engraved on a silver plate was sometimes prescribed as a charm against the plague, and one, namely, that represented in figure i on page , is drawn in the picture of Melancholy, painted about the year 1500 by Albert Dürer. Such charms are still worn in the East.

The development of the theory has been due mainly to French mathematicians. Bachet gave a rule for the construction of any square of an odd order in a form substantially equivalent to one of the rules given by Moschopulus. The formation of magic squares, especially of even squares, was considered by Frénicle and Fermat. The theory was continued by Poignard, De la Hire, Sauveur, D'Ons-en-bray, and Des Ourmes. Ozanam included in his work an essay on magic squares which was amplified by Montucla. From this and from De la Hire's memoirs the larger part of the materials for this chapter are derived. Like most algebraical problems,

the construction of magic squares attracted the attention of Euler, but he did not advance the general theory. In 1837 an elaborate work on the subject was compiled by B. Violle, which is useful as containing numerous illustrations. I give the references in a footnote (Bachet, Problèmes plaisans, Lyons, 1624, problem xxi, p. 161; Frénicle, Divers Ouvrages de Mathématique par Messieurs de l'Académie des Sciences, Paris, 1693, pp. 423--483; with an appendix (pp. 484--507), containing diagrams of all the possible magic squares of the fourth order, 880 in number: Fermat, Opera Mathematica, Toulouse, 1679, pp. 173--178; or Brassinne's Précis, Paris, 1853, pp. 146--149: Poignard, Traité des Quarrés Sublimes, Brussels, 1704: De la Hire, Mémoires de l'Académie des Sciences for 1705, Paris, 1706, part i, pp. 127--171; part ii, pp. 364--382: Sauveur, Construction des Quarrés Magiques, Paris, 1710: D'Ons-en-bray, Mémoires de l'Académie des Sciences for 1750, Paris, 1754, pp. 241--271: Des Ourmes, Mémoires de Mathématique et de Physique (French Academy), Paris, 1763, vol. iv, pp. 196--241: Ozanam and Montucla, Récréations, part i, chapter xii: Euler, Commentationes Arithmeticae Collectae, St Petersburg, 1849, vol. ii, pp. 593--602: Violle, Traité Complet des Carrés Magiques, 3 vols, Paris, 1837--8. A sketch of the history of the subject is given in chap. iv of S. Günther's Geschichte der mathematischen Wissenschaften, Leipzig, 1876. See also W. Ahrens, Mathematische Unterhaltungen und Spiele, Leipzig, 1901, chapter xii.).

I shall confine myself to establishing rules for the construction of squares subject to no conditions beyond those given in the definition. Rules sufficient for this purpose are contained in the works to which I have just referred and on which I have based this sketch; some extensions and developments will be found in the memoirs mentioned below (In England the subject has been studied by R. Moon, Cambridge Mathematical Journal, 1845, vol. iv, pp. 209--214; H. Holditch, Quarterly Journal of Mathematics, London, 1864, vol. vi, pp. 181--189; W.H. Thompson, , 1870, vol. x, pp. 186--202; J. Horner, , 1871, vol. xi, pp. 57--65, 123--132, 213--224; S.M. Drach, Messenger of Mathematics, Cambridge, 1873, vol. ii, pp. 169--174, 187; A.H. Frost, Quarterly Journal of Mathematics, London, 1878, vol. xv, pp. 34--49, 93--123, 366--368, in which the results of previous memoirs are included: there are also some pamphlets and articles on it of a more popular character. Of recent Continental works on the subject I have no complete bibliography, and probably it is better to omit all rather than give an imperfect list.). I

shall commence by giving rules for the construction of a square of an odd order, and then shall proceed to similar rules for one of an even order.

It will be convenient to use the following terms. The spaces or small squares occupied by the numbers are called cells. The diagonal from the top left-hand cell to the bottom right-hand cell is called the leading diagonal or left diagonal. The diagonal from the top right-hand cell to the bottom left-hand cell is called the right diagonal.

[Construction of Odd Magic Squares] [Magic Squares of an odd order.]Magic Squares of an odd order I proceed to give methods for constructing odd magic squares, but for simplicity I shall apply them to the formation of squares of the fifth order, though exactly similar proofs will apply equally to any odd square.

De la Loubère's Method (De la Loubère, Du Royaume de Siam (Eng. Trans.), London, 1693, vol. ii, pp. 227--247. De la Loubère was the envoy of Louis XIV to Siam in 1687--8, and there learnt this method.) tocsubsectionMethod of De la Loubère If the reader

will look at figure:iiifigure iii he will see one way in which such a square containing 25 cells can be constructed. The middle cell in the top row is occupied by 1. The successive numbers are placed in their natural

order in a diagonal line which slopes upwards to the right, except that (i) when the top row is reached the next number is written in the bottom row as if it came immediately above the top row; (ii) when the right-hand column is reached, the next number is written in the left-hand column, as if it

immediately succeeded the right-hand column; and (iii) when a cell which has been filled up already, or when the top right-hand square is reached, the path of the series drops to the row vertically below it and then continues to mount again. Probably a glance at the diagram in figure:iiifigure iii will make this clear.

The reason why such a square is magic can be explained best by expressing the numbers in the scale of notation whose radix is 5 (or n , if the magic square is of the order n ), except that 5 is allowed to appear as a unit-digit and 0 is not allowed to appear as a unit-digit. The result is shown in figure:iiifigure iv. From that figure it will be seen that the method of construction ensures that every row and every column shall contain one and only one of each of the unit-digits 1 , 2 , 3 , 4 , 5 , the sum of which is 15 ; and also one and only one of each of the radix-digits 0 , 5 , 10 , 15 , 20 , the sum of which is 50. Hence, as far as rows and columns are concerned, the square is magic. Moreover if the square is odd, each of the diagonals will contain one and only one of each of the unit-digits 1 , 2 , 3 , 4 , 5. Also the leading diagonal will contain one and only one of the radix-digits 0 , 5 , 10 , 15 , 20 , the sum of which is 50 ; and if, as is the case in the square drawn above, the number 10 is the radix-digit to be added to the unit-digits in the right diagonal, then the sum of the radix-digits in that diagonal is also 50. Hence the two diagonals also possess the magical property.

And generally if a magic square of an odd order n is constructed by De la Loubère's method, every row and every column must contain one and only one of each of the unit-digits 1, 2, 3..., n ; and also one and only one of each of the radix-digits 0, n, 2n..., n(n-1). Hence, as far as rows and columns are concerned, the square is magic. Moreover each diagonal will either contain one and only one of the unit-digits or will contain n unit-digits each equal to 1/2(n+1). It will also either contain one and only one of the radix-digits or will contain n radix-digits each equal to 1/2n(n-1). Hence the

two diagonals will also possess the magical property. Thus the square will be magic.

I may notice here that, if we place 1 in any cell and fill up the square by De la Loubère's rule, we shall obtain a square that is magic in rows and in columns, but it will not in general be magic in its diagonals.

It is evident that other squares can be derived from De la Loubère's square by permuting the symbols properly. For instance, in figure:iiifigure iv, we may permute the symbols 1 , 2 , 3 , 4 , 5 in 5! ways, and we may permute the symbols 0 , 5 , 15 , 20 in

4! ways. Any one of these 5! arrangements combined with any one of these 4! arrangements will give a magic square. Hence we can obtain 2880 magic squares of the fifth order of this kind, though only 720 of them are really distinct. Other squares can however be deduced, for it may be noted that from any magic square, whether even or odd, other magic squares of the same order can be formed by the mere interchange of the row and the column which intersect in a cell on a diagonal with the row and the column which intersect in the complementary cell of the same diagonal

.

Bachet's Method (Bachet, Problem xxi, p. 161.)tocsubsectionMethod of Bachet Another method, very similar to that of De la Loubère, for constructing an odd magic square is as follows. We begin by placing 1 in the cell above the middle one (that is, in a square of the fifth order in the cell occupied by the number 7 in figure:iiifigure iii), and then we write the successive numbers in a diagonal line sloping upwards to the right, subject to the condition that when the cases (i) and (ii) mentioned under De la Loubère's method occur the rules there given are followed, but when the case (iii) occurs the path of the series rises two rows, it is continued from one cell to the cell next but one vertically above it, if this cell is above the top row the path continues from the corresponding cell in one of the bottom two rows following the analogy of rule (i) in De la Loubère's method. Such a square is delineated in figure v on page. Bachet's method leads ultimately to this arrangement; except

that the rules are altered so as to make the line slope downwards. This method also gives 720 magic squares of the fifth order.

De la Hire's Method (Mémoires de l'Académie des Sciences for 1705, part i, pp. 127--171.) tocsubsectionMethod of De la Hire I shall now give another rule

for the formation of odd magic squares. To form an odd magic square of the order n by this method, we begin by constructing two subsidiary squares, one of the unit-digits, 1, 2..., n , and the other of multiples of the radix, namely, 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.

De la Hire gave several ways of constructing such subsidiary squares. I select the following method (props. x and xiv of his memoir) as being the simplest, but I shall apply it to form a square of only the fifth order. It leads to the same results as the second of the two rules given by Moschopulus.

The first of the subsidiary squares (figure vi, [below]figure:vi), is constructed thus. First, 3 is put in the top left-hand corner, and then the numbers 1 , 2 , 4 , 5 are written in the other cells of the top line (in any order). Next, the number in each cell

of the top line is repeated in all the cells which lie in a diagonal line sloping downwards to the right (see figure:vifigure vi) according to the rule (ii) in De la Loubère's method. The cells filled by the same number form a broken diagonal. It follows that every row and every column contains one and only one 1 , one and only one 2 , and so on. Hence the sum of the numbers in every row

and in every column is equal to 15 ; also, since we placed 3 , which is the average of these numbers, in the top left-hand corner, the sum of the numbers in the left diagonal is 15 ; and, since the right diagonal contains one and only one of each of the numbers 1 , 2 , 3 , 4 , and 5 , the sum of the numbers in that diagonal also is 15.

The second of the subsidiary squares (figure:vifigure vii) is constructed in a similar way with the numbers 0 , 5 , 10 , 15 , and 20 , except that the mean number 10 is placed in the top right-hand corner; and the broken diagonals formed of the same numbers all slope downwards to the left. It follows that every row and every column in figure:vifigure vii contains one and only one 0 , one and only one 5 , and so on; hence the sum of the numbers in every row and every column is equal to 50. Also the sum of the numbers in each diagonal is equal to 50.

If now we add together the numbers in the corresponding cells of these two squares, we shall obtain 25 numbers such that the sum of the numbers in every row, every column, and each diagonal is equal to 15 + 50 , that is, to 65. This is represented in figure viii. Moreover, no two cells in that figure contain the same number. For instance, the numbers 21 to 25 can occur only in those five cells which in figure:vifigure vii are occupied by the number 20 , but the corresponding cells in figure:vifigure vi contain respectively the numbers 1 , 2 , 3 , 4 , and 5 ; and thus in figure:vifigure viii each of the numbers from 21 to 25 occurs once and only once. De la Hire preferred to have the cells in the subsidiary squares which are filled by the same number connected by a knight's move and not by a bishop's move; and usually his rule is enunciated in that form.

By permuting the numbers 1 , 2 , 4 , 5 in figure:vifigure vi we get 4! other arrangements, each of which combined with that in figure:vifigure vii would give a magic square. Similarly by permuting the numbers 0 , 5 , 15 , 20 in figure:vifigure vii we obtain 4! other squares, each of which might be combined with any of the 4! arrangements deduced from figure:vifigure vi. Hence altogether

we can obtain in this way 576 magic squares of the fifth order.

There is yet another method of constructing odd squares which is due to Poignard, and was improved by De la Hire in the memoir already cited. I shall not discuss it, because, though for certain assigned values of n it is simpler than the methods which I have given, it depends on the form of n , and particularly on the number of prime factors of n. In the case of a square of the fifth order, this gives an even larger number of magic squares than the methods of De la Loubère, Bachet, and De la Hire. I may also add that it has been shown that magic squares whose order is a prime number can be constructed by a rule similar to De la Loubère's, except that we begin by placing 1 in the bottom left-hand cell, and the subsequent consecutive numbers fill cells forming a knight's path on the square and not a bishop's path. A square of the fifth order of this kind is given in figure xiii on page. There are 2880 magic squares of the fifth order of this kind.

De la Hire showed that, apart from mere inversions, there were 57600 magic squares of the fifth order which could be formed by the methods he enumerated. Taking account of other methods, it would seem that the total number of magic squares of the fifth order is very large, perhaps exceeding 500000.

[Construction of Even Magic Squares] [Magic squares of an even order.]Magic squares of an even order The above methods are inapplicable to squares of an even order. I proceed to give two methods for constructing any even magic square of an order higher than two.

It will be convenient to use the following terms. Two rows which are equidistant, the one from the top, the other from the bottom, are said to be complementary. Two columns which are equidistant, the one from the left-hand side, the other from the right-hand side, are said to be complementary. Two cells in the same row, but in complementary columns, are said to be horizontally related. Two cells in the same column, but in complementary rows, are said to be vertically related.

Two cells in complementary rows and columns are said to be skewly related; thus, if the cell b is horizontally related to the cell a , and the cell d is vertically related to the cell a , then the cells b and d are skewly related; in such a case if the cell c is vertically related to the cell b , it will be horizontally related to the cell d , and the cells a and c are skewly related: the cells a , b , c , d constitute an associated group, and if the square is divided into four equal quarters, one cell of an associated group is in each quarter.

A horizontal interchange consists in the interchange of the numbers in two horizontally related cells. A vertical interchange consists in the interchange of the numbers in two vertically related cells. A skew interchange consists in the interchange of the numbers in two skewly related cells. A cross interchange consists in the change of the numbers in any cell and in its horizontally related cell with the numbers in the cells skewly related to them; hence, it is equivalent to two vertical interchanges and two horizontal interchanges.

First Method (See an article in the Messenger of Mathematics, Cambridge, September, 1893, vol. xxiii, pp. 65--69.)tocsubsectionFirst Method This method is the simplest with which I am acquainted, and I believe, at any rate as far as concerns singly-even squares, was published for the first time in 1893.

Begin by filling the cells of the square with the numbers 1, 2..., n^2 in their natural order commencing (say) with the top left-hand corner, writing the numbers in each row from left to right, and taking the rows in succession from the top. I will commence by proving that a certain number of horizontal and vertical interchanges in such a square must make it magic, and will then give a rule by which the cells whose numbers are to be interchanged can be at once picked out.

First, we may notice that the sum of the numbers in each diagonal is equal to N , where N = 1/2n (n^2 + 1) ; hence the diagonals are already magic, and will remain so if the numbers therein are not altered.

Next, consider the rows. The sum of the numbers in the x th row from the top is N-1/2n^2(n-2x+1). The sum of the numbers in the complementary row, that is, the x th row from the bottom, is N + 1/2n^2(n-2x + 1). Also the number in any cell in the x th row is less than the number in the cell vertically related to it by n(n-2x + 1). Hence, if in these two rows we make 1/2n interchanges of the numbers which are situated in vertically related cells, then we increase the sum of the numbers in the x th row by 1/2n × n(n-2x + 1) , and therefore make that row magic; while we decrease the sum of the numbers in the complementary row by the same number, and therefore make that row magic. Hence, if in every pair of complementary rows we make 1/2n interchanges of the numbers situated in vertically related cells, the square will be made magic in rows. But, in order that the diagonals may remain magic, either we must leave both the diagonal numbers in any row unaltered, or we must change both of them with those in the cells vertically related to them.

The square is now magic in diagonals and in rows, and it remains to make it magic in columns. Taking the original arrangement of the numbers (in their natural order) we might have made the square magic in columns in a similar way to that in which we made it magic in rows. The sum of the numbers originally in the y th column from the left-hand side is N-1/2n (n-2y + 1). The sum of the numbers originally in the complementary column, that is, the y th column from the right-hand side, is N + 1/2n(n-2y +1). Also the number originally in any cell in the y th column was less than the number in the cell horizontally related to it by n-2y+1. Hence, if in these two columns we had made 1/2n 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/2n interchanges of the numbers in vertically related cells, and that in every row there shall be exactly 1/2n interchanges of the numbers in horizontally related cells. I proceed to show how we can always ensure this, if n is greater than 2. I continue to suppose that the cells are initially filled with the numbers 1, 2..., n^2 in their natural order, and that we work from that arrangement.

A doubly-even square is one where n is of the form 4m. If the square is divided into four equal quarters, the first quarter will contain 2m columns and 2m rows. In each of these columns take m cells so arranged that there are also m cells in each row, and change the numbers in these 2m^2 cells and the 6m^2 cells associated with them by a cross interchange. The result is equivalent to 2m interchanges in every row and in every column, and therefore renders the square magic.

One way of selecting the 2m^2 cells in the first quarter is to divide the whole square into sixteen subsidiary squares each containing m^2 cells, which we may represent by the diagram

below, and then we may take either the cells in the a squares

or those in the b squares; thus, if every number in the eight a 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.

Another way of selecting the 2m^2 cells in the first quarter would be to take the first m cells in the first column, the cells 2 to m + 1 in the second column, and so on, the cells m + 1 to 2m in the (m + 1) th column, the cells m + 2 to 2m and the first cell in the (m + 2) th column, and so on, and finally the 2m th cell and the cells 1 to m - 1 in the 2m th column.

A singly-even square is one where n is of the form 2(2m + 1). If the square is divided into four equal quarters, the first quarter will contain 2m + 1 columns and 2m + 1 rows. In each of these columns take m cells so arranged that there are also m cells in each row: as, for instance, by taking the first m cells in the first column, the cells 2 to m + 1 in the second column, and so on, the cells m + 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 cells 1 to m - 1 in the (2m + 1) th column. Next change the numbers in these m (2m + 1) cells and the 3m (2m + 1) cells associated with them by cross interchanges. The result is equivalent to 2m interchanges in every row and in every column. In order to make the square magic we must have 1/2n , 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 the 2m th 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 the 2m th 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 columns magic without affecting the magical properties of the rows.

It will be observed that we have implicitly assumed that m is not zero, that is, that n is greater than 2; also it would seem that, if m=1 and therefore n=6 , then the numbers in the diagonal cells must be included in those to which the cross interchange is applied, 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 (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.) tocsubsectionMethod of De la Hire and Labosne 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 series 1,2,3...,n are said to be complementary. Similarly numbers which are equidistant from the ends of the series 0,n,2n...,(n-1)n 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 ( 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 either with the same number as that already in two of them or with the complementary number ( in figure:ixfigure 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:ixfigure 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 ( in figure:ixfigure 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:ixfigure ix and its vertically related cell are filled with complementary numbers, then the corresponding cell in the first row of figure:ixfigure x and its horizontally related cell must be occupied by the same number (The insertion of this step evades the necessity of constructing (as Montucla did) a third subsidiary square.). 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 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 n 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 n 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 n 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:ixfigure 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 may be constructed by the above rules; and the reader will have no difficulty in applying them to any other even square

.

[Composite Magic Squares][Composite and Bordered Squares.] 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 m th and n th orders, we can construct one of the mn th order. For example, a square of 81 cells may be considered as composed of 9 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.

Bordered Magic Squares The second method, which was introduced by Frénicle, consists in surrounding a magic square with a border. Thus

in figure xii figure:xii 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 the 3 rd order we can build up successively squares of the orders 5 , 7 , 9 , &c., that is, any odd magic square. Similarly from the magic square of the 4 th order we can build up successively any higher even magic square.

If we construct a magic square of the first n^2 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 first 2 (n-1) natural numbers and the last 2(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 n th order is 1/2(n^2+1). The difference of these is 2(n-1). We begin then by taking any magic square of the order (n-2) , and we add to every number in it 2(n-1) ; this makes the average number 1/2(n^2 + 1).

The numbers reserved for the border occur in pairs, n^2 and 1 , n^2-1 and 2 , n^2-2 and 3 , &c., such that the average of each pair is 1/2(n^2 + 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 number n^2 + 1-p (which has to be placed opposite to the number p ) is denoted by p , 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:xiifigure xii is constructed. A magic square of the third order is formed by De la Loubère's rule, and to every number in it 8 is added: the result is the inner square in figure:xiifigure 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 is 26 , and obviously they must be 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 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 imposition of additional conditions; some of the resulting problems involve mathematical difficulties of a high order.

[Pan-diagonal or Nasik Squares][Hyper-Magic Squares.] 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 called nasik squares or pan-diagonal magic squares: in France carré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 , 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 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 , and one of the fifth order is represented in figure xiii figure:xii. Nasik squares of the order 6n ± 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 number kn to that occupied by the number kn + 1 have to be laid down.

Doubly-Magic Squares tocsubsectionDoubly Magic Squares In another species of hyper-magic squares the problem is to construct a magic square of the n th order in such a way that if the number in each cell is replaced

by its m th power the resulting square shall also be magic. Here for example (see figure:xivfigure xiv) is a magic square (See M. Coccoz in L'Illustration, May 29, 1897.) of the eighth order, the sum of the numbers in each line being equal to 260 , 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 to 11180 )

.

Magic Pencils

Hitherto I have concerned myself with

numbers arranged in lines. By reciprocating the figures composed of the 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 (See Magic-Reciprocals by G. Frankenstein, Cincinnati, 1875.). Thus, in a magic square of the n th order, we arrange n^2 consecutive numbers to form 2n + 2 lines, each containing n numbers so that the sum of the numbers in each line is the same. Reciprocally we can arrange n^2 lines, numbered consecutively to form 2n + 2 pencils, each containing n lines, so that in each pencil the sum of the numbers designating the lines is the same.

For instance, figure:xvfigure xv represents a magic square of 64

consecutive numbers arranged to form 18 lines, each of 8 numbers. Reciprocally, figure:xvifigure 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 at O ; 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:xvfigure xv is the same. To make figure:xvifigure xvi correspond to this we must number the lines in the pencil A from left to right, 1, 9..., 57 , following the order of the numbers in the first column of the square: the lines in pencil B 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 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 perpendicular to it. The whole figure will now give 8^3 lines, arranged in 244 pencils each of 8 rays, and will be the reciprocal of a magic cube of the 8 th order. If we reciprocate back again we obtain a representation in a plane of a magic cube

.

[Magic Puzzles][Magic Puzzles.]Magic Square Puzzles Many empirical problems, closely related 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 (Ozanam, 1723 edition, vol. iv, p. 434.) tocsubsectionCard 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 [below]figure:xviii.

Euler's Officers Problem (Euler's Commentationes Arithmeticae, St Petersburg, 1849, vol ii, pp. 302--361. See also a paper by G. Tarry in the Comptes rendus of 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.) tocsubsectionEuler'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 the 1 st, 2 nd, 3 rd, 4 th, 5 th, and 6 th 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, containing n^2 cells, of n^2 counters (the counters being divided into n groups, each group consisting of n counters of the same colour numbered consecutively 1, 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 a_1 , a_2 , a_3 , three white counters b_1, b_2 , b_3 , and three black counters c_1 , c_2 , c_3 , we can satisfy the conditions by arranging them as in figure xvii [below]figure:xviii. If n = 4 , then with counters a_1 , a_2 , a_3 , a_4 ; b_1 , b_2 , b_3 , b_4 ; c_1 , c_2 , c_3 , c_4 ; d_1 , d_2 , d_3 , d_4 , we can arrange them as in figure xviii [below]figure:xviii. A solution when n = 5 is indicated in 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 tocsubsectionDomino Squares Analogous problems can be made with dominoes. An ordinary set of dominoes, ranging from double zero to double six, contains 28 dominoes. Each domino is a rectangle formed by fixing two small square blocks together side by side: of these 56 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 the 56 blocks form a square of 7 by 7 bordered by one line of 7 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 (See L'Illustration, July 10, 1897.) is given [above]illus:182.

Similarly, a set of dominoes, ranging from double zero to double n , 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/2n(n+2) ?

Magic Coin Squares (See The Strand Magazine, London, December, 1896, pp. 720, 721.)tocsubsectionCoin Squares There are somewhat similar questions concerned with coins. Here is one applicable to a square of the third order divided into nine cells, as in figure xvii [above]figure:xviiifigure:xviii.

If a five-shilling piece is placed in the middle cell c_1 and a florin in the cell below it, namely, in a_3 it is required to place the fewest possible current English coins in 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 suffice. 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.

· · ·

End of part 7 of 16

Continue readingChapter VI: Unicursal Problems