## Numbers: Their Tales, Types, and Treasures.

## Chapter 7: Placement of Numbers

### 7.3.HOW TO CONSTRUCT A DOUBLY-EVEN MAGIC SQUARE

Since we have the Dürer square at hand, we will begin by discussing the construction of the doubly-even magic squares. Let us begin with the smallest of these—namely, those with four rows and columns. We begin our construction of this doubly-even magic square by first placing the numbers in the square in numerical order, as shown in the first square of __figure 7.6__.

**Figure 7.6: Constructing Dürer's square in three steps.**

This is not yet a magic square, because all the small numbers are in the first row and the large numbers are in the last row. But a quick inspection shows that the sum along each diagonal already has the required value of 34. Any rearrangement of the numbers within a diagonal will not change their sum. In the next step, we must try to get some of the large numbers into the upper part of the square. To do this we will exchange within the first diagonal (the “main diagonal”) the numbers 1 and 16 and the numbers 6 and 11. Similarly, in the secondary diagonal, we will exchange the numbers 13 and 4, as well as the numbers 10 and 7. The cells to be changed are shaded in the second square of __figure 7.6__. We now have been able to get some large numbers in the first row, and, indeed, the sum of the first row is 34! Quickly checking the remaining rows and columns reveals that this square is indeed a magic square. (No need to check the diagonals again, because exchanging numbers within a diagonal does not change its sum!) Thus, we have constructed our first magic square! However, the magic square we have obtained is *not* the same as the one that Dürer pictured in his *Melencolia I* etching. Dürer apparently interchanged the positions of the two middle columns to allow his square to show the date that the picture was made, 1514, in the middle of the bottom row. This resulting arrangement of numbers is shown as the last square in __figure 7.6__, which is Dürer's magic square, and it has many more properties than the magic square constructed in the first step.

Once you have obtained a magic square, you can try to generate a new one by starting with the given magic square. Any change you apply to an existing magic square should not change the sums of rows, columns, and diagonals. For example, if you exchange the second and the third column, as Dürer did in the second step described above in __figure 7.6__, this had no influence on the sums along the rows. But it might change the sum along the diagonals because this step exchanges numbers between the diagonals. In general, this can be repaired by switching the second and third *row*, which does not change the sum along the columns but restores the numbers in the diagonals. You might want to try this for the Chautisa Yantra of __figure 7.2__. This one would not remain a magic square if only the two central columns were exchanged. There you would have to exchange the central rows as well. Dürer's square is again special in that it remains a magic square when columns 2 and 3 are exchanged (and also if you exchange columns 1 and 4, or rows 1 and 4, or rows 2 and 3).

In general, exchanging columns 1 and 4 (or for that matter, columns 2 and 3) and then exchanging the corresponding rows would preserve the “magic property” of a square.

Another general method to create a new magic square from an existing one is to replace each number by its complement. The complement of a number *a* in a magic square is a number *b*, such that *a* + *b* is 1 greater than the number of cells. In a square of order 4, two numbers are complementary if their sum is 17. (The first step in __figure 7.6__ can also be described as the replacement of the numbers in the diagonals by their complements).

You may wish to generate new magic squares using this technique. There are a total of 880 possible magic squares of order 4. By the way, there is no magic square of order 2, and there is essentially only one magic square of order 3—the Lo Shu square of __figure 7.1__—because all other magic squares of order 3 can be obtained from the Lo Shu square by rotation or reflection.

The next larger doubly-even magic square is of order 8—that is, with eight rows and columns. Once again we place the numbers in the cells in proper numerical order, as shown in __figure 7.7__.

**Figure 7.7: First step in the construction of a magic square of order 8.**

This time we will once again replace the numbers in the diagonals by their complement—in this case, the complement of a number is the number that will produce a sum of 65. However, the diagonals in this case are the diagonals of each of the 4 × 4 squares included in the 8 × 8 square—here they are the shaded numbers. The completed magic square with all the appropriate cell changes is shown in __figure 7.8__.

**Figure 7.8: A magic square of order 8.**