Magic Squares

A touch of mysticism and a lot of brain-challenging fun!

Posted Jun 29, 2015

Magic Squares: A touch of mysticism and a lot of brain-challenging fun!

By Marcel Danesi, Ph.D. in Brain Workout

One of the most fascinating number games of all time is the magic square. In its original version it consisted of the first nine integers—1, 2, 3, 4, 5, 6, 7, 8, 9—arranged in a square pattern so that the sum of the numbers in each row, column, and diagonal is the same. This is called Lo Shu in China, from where it originated maybe as far back as 3000 BCE. From the outset, the arrangement was called “magical” because the Chinese ascribed mystical properties to it. To this day, it is thought by many to provide protection against the Evil Eye when placed over the entrance to a room. Fortunetellers have used it to cast fortunes. In the late medieval period, amulets and talismans were designed with magic squares inscribed in them. More importantly, mathematicians in the Europe, China, India, and other places became fascinated by the numerical properties of magic squares and started studying them seriously and are still doing so.

The three rows, three columns, and two diagonals of Lo Shu add up to “15”. This is known as the magic constant:

8    3    4
1    5    9
6    7    2

This is called a magic square of “order 3”, a term indicating the number of cells in the square (“3 × 3”). A “4 × 4” square is called an “order 4” magic square, a “5 × 5” square an “order 5” magic square, and so on. In general, an “n × n” (= “n2”) square is called an “order n” magic square. By the way, the digits in Lo Shu can be arranged in several other ways to produce the magic constant of 15 (such as with a mirror reflection arrangement).

One version of the Lo Shu legend tells that a huge flood was brought upon the people by the god of the Lo River. To calm his anger, the people offered sacrifices to him. But after each sacrifice a turtle would surface from the river, walking around nonchalantly. The people saw this as a sign of rejection of their sacrifices. It was during one of the turtle’s appearances that a child noticed a square on its shell. In it were the first nine digits arranged in three rows and columns with the numbers along the rows, columns and two diagonals adding up to 15. From this, the people realized the number of sacrifices required of them before the river god would be appeased.

Another version of the legend tells of Emperor Yu the Great walking along the banks of the Lo River, when he saw a mysterious turtle crawl from it. On its shell was the magic square. Like the child, he noticed the pattern in it, perceiving it as a message from the gods.

Lo Shu spread from China to other parts of the world in the second century CE. Around 1300, the Greek mathematician Emanuel Moschopoulos introduced it to Europe. Devising different kinds of magic squares became a veritable craze shortly thereafter. Medieval astrologers perceived occult properties in the squares, using them to cast horoscopes. They also saw them as concealing coded divine messages. The astrologer Cornelius Agrippa (1486-1535), for example, believed that a magic square of one cell (a square containing the single digit 1) represented the eternal perfection of God. Agrippa also took the fact that a 2 × 2 magic square could not be constructed to be proof of the imperfection of the four elements: air, earth, fire, and water.

To solve magic squares, it is useful to determine the magic constant. Without going into the mathematical details, suffice it to say that the sum of the digits divided by the order of the square will produce the magic square constant. So, in the case of an order 3 magic square we add up the integers (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45) and divide the sum by 3 (the order of the square): 45 ÷ 3 = 15. An order 4 magic square consists of the first 16 numbers arranged in a 4-by-4 arrangement. Thus, the magic square constant is the sum of the first 16 digits (= 136) divided by 4 (the order of the square). This gives 34.

Order 4 magic squares were found in India dating back to at least the eleventh century. Perhaps the most famous of all these was the one by the German painter Albrecht Dürer (1471-1528), which he included in his famous 1514 engraving Melancholia. It is given below. 

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

There are over 800 possible arrangements of the first 16 integers in a magic square pattern. One of the most extraordinary of all magic squares was the order 8 magic square devised by Benjamin Franklin (1706-1790):

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

Magic squares can be constructed with any collection of digits, not just those in consecutive order. Fascinated by magic squares, the great mathematician Leonhard Euler (1707-1783) constructed the first ever “magic square of squares” in 1770. It was an order 4 magic square consisting of square numbers in the cells:

682    292    412    372
17   312    792    322
592    282    232    612
112    772    82      492

Mind-boggling, isn’t it? Examples of 5-by-5, 6-by-6 and 7-by-7 magic squares of squares have since been constructed. However, no one has ever constructed a 3-by-3 magic square of squares nor proved it to be impossible. The late Martin Gardner (1914-2010), who wrote a fascinating puzzle column for Scientific American for many years, offered a one hundred dollar prize in 1996 to anyone who could devise a solution. There have been near misses, but to the best of my knowledge, no has yet been able to do so (unless readers of this blog may know otherwise).

Today, magic squares are often included in puzzle collections and they are used as brainteasers by many math teachers for pedagogical purposes. Although they are not as popular as Sudoku, they are much more challenging (in my view). I know of no specific research on any brain benefits that might result from doing magic squares (if some reader does, please leave a comment). They are probably as beneficial, if not more so, than Sudoku. They require a great deal of concentration and logical thinking, posing a considerable challenge to the brain.

Now, try these five puzzles. There are methods for constructing magic squares and of course algorithms. And there is a plethora of websites that can show you how to formulaically make and solve magic squares. But the point here is to enjoy a unique brain workout session, putting aside all the formal techniques that are for experts and amateur enthusiasts.

Puzzles

1. Arrange the following nine consecutive numbers {4, 5, 6, 7, 8, 9, 10, 11, 12} into an order 3 magic square. What is the magic constant of the square? In this particular square you are told that the number "7" is in the top left-most cell and the number "8" in the middle cell.

2. Now, try your hand at arranging the following consecutive nine numbers {10, 11, 12, 13, 14, 15, 16, 17, 18} into an order 3 magic square. What is the magic constant of the square? In this particular square you are told that the number "17" is in the top left-most cell and the number "14" in the middle cell.

3. Can you arrange the first sixteen consecutive numbers {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} into an order 4 magic square? What is the magic constant of the square? In this particular square you are told that the number "2" is in the top left-most cell, the number "16" in the bottom right-most cell, and the number "13" in the top right-most cell.

4. Now, can you arrange the same sixteen consecutive numbers {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} into another order 4 magic square?  In this particular square you are told that the number "1" is in the top left-most cell, the number "6" in the bottom right-most cell, and the number "12" in the top right-most cell.

5. Finally, for the most challenging of all the five puzzles, can you arrange the first consecutive twenty-five numbers {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25} into an order 5 magic square? What is the magic constant of the square?  In this particular square you are told that the number "14" is in the top left-most cell, the number "12" in the bottom right-most cell, the number "18" in the top right-most cell, and the number "13" in the middle cell.

Answers

1. The magic constant is 24.

  7     6    11
12     8     4
  5    10    9

2. The magic constant is 42.

17    10    15
12    14    16
13    18    11

3. The magic constant is 34.

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

4. The magic constant is (again) 34.

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

5. The magic constant is 65.

14    10     1     22    18
20    11     7      3      24
21    17    13     9       5
2      23    19    15      6
8       4      25   16     12