# 9×9 Magic Squares by the Lo Shu Method

The Lo Shu method generated the only 3×3 magic square that exists (rotations and reversals of the same 3×3 arrangement notwithstanding), and was the first magic square known to be discovered by humans, over 3000 years ago in China. Because of the one magic square it yields, utilizing the Lo Shu method recursively for 9×9 can only generate exactly one 9×9 magic square. A casual glance on Google will tell you that there are many more 9×9 squares out there that break the patterns that we are about to explore.

My preference has always been to discuss algorithms for magic squares that are “high-yielding”, or lead to many distinct magic squares, such as 5×5 (14,400 squares), and 7×7 (over 25 million squares). Why spend an article discussing the one possible square generated by the Lo Shu algorithm? I think this is because this has a great many unique patterns, and there are many “little” squares, each with their own magic numbers. It is not pan-magic in the normal way, but it seems to have multiple magical properties nonetheless.

The basic Lo Shu square begins with an ordered arrangement of the digits 1-9 in a 3×3 matrix:

```                 1  2  3
4  5  6
7  8  9```

Switch each corner number with the number kitty-corner to it:

```                9  2  7
4  5  6
3  8  1```

Then, imagine pressing the 9 to go between the 4 and 2, to create a new row, and doing the same with the 1 in placing it between the 8 and the 6. The diagonal 3  5  7 becomes the middle row of the new square. It would look thus:

```                4  9  2
3  5  7
8  1  6```

The result is a 3×3 square that is magic, and is the only 3×3 magic square of sequential digits 1-9 that exists. Beware of reflections and rotations of these squares, since they are still the same square.

The reason for showing the construction of the 3×3 square is because constructing the 9×9 square follows a strangely identical pattern.

### The 9×9 Lo Shu square is built on the same pattern

The same principle that created the 3×3 square can be used to make a 9×9 square. The drawback is that this method will again only yield one square. In truth, there are thousands of 9×9 squares possible. You begin with the numbers 1 to 81 in sequence in a 9×9 array:

 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

Let’s look at the first column. We make a 3×3 array out of this, starting by placing the numbers in numerical order in the same manner done with the numbers 1 to 9 earlier:

```                         1   10   19
28   37   46
55   64   73```

Then, we switch the corner numbers again:

```                       73   10   55
28   37   46
19   64    1```

Form new rows as described earlier, resulting in the top being 28  73  10, and the bottom being 64  1  46, with 19  37  55 being the middle row:

```                       28   73   10
19   37   55
64    1   46```

The result is a 3×3 sub-square that itself is magic. You can repeat this for the second column:

```                       29   74   11
20   38   56
65    2   47```

But then you would notice that each cell in this new 3×3 sub-square is one more than each corresponding cell in the previous 3×3 sub-square. Thus, the remaining sub-squares can be obtained by adding 1 to the previous sub-square when doing each of the columns in order from the original 9×9 square. You get the following intermediate 9×9 square:

 28 73 10 29 74 11 30 75 12 19 37 55 20 38 56 21 39 57 64 1 46 65 2 47 66 3 48 31 76 13 32 77 14 33 78 15 22 40 58 23 41 59 24 42 60 67 4 49 68 5 50 69 6 51 34 79 16 35 80 17 36 81 18 25 43 61 26 44 62 27 45 63 70 7 52 71 8 53 72 9 54

OK, so we are not quite there yet. The light grey and white patterns denote the nine 3×3 sub-squares that we were just discussing. But in the manner done for the initial 3×3 squares, we need to:

1. Switch out the corner 3×3 sub-squares, as shown below.
 36 81 18 29 74 11 34 79 16 27 45 63 20 38 56 25 43 61 72 9 54 65 2 47 70 7 52 31 76 13 32 77 14 33 78 15 22 40 58 23 41 59 24 42 60 67 4 49 68 5 50 69 6 51 30 75 12 35 80 17 28 73 10 21 39 57 26 44 62 19 37 55 66 3 48 71 8 53 64 1 46
2. Finally, make the magic square from the sub-squares going diagonally. That is, make a top row of the three sub-squares in the top left corner; then make a bottom row of the three sub-squares in the bottom right corner. The middle rows of the 9×9 square will consist of the three sub-squares extending from the bottom left to the top right. In this manner, we would have formed the magic square in the precise pattern that we used for individual numbers when we did the original 3×3 square. Below is the square, revelaling the magic number totals on the rows, columns, and diagonals:
 31 76 13 36 81 18 29 74 11 369 22 40 58 27 45 63 20 38 56 369 67 4 49 72 9 54 65 2 47 369 30 75 12 32 77 14 34 79 16 369 21 39 57 23 41 59 25 43 61 369 66 3 48 68 5 50 70 7 52 369 35 80 17 28 73 10 33 78 15 369 26 44 62 19 37 55 24 42 60 369 71 8 53 64 1 46 69 6 51 369 369 369 369 369 369 369 369 369 369 369 369

The feature of this square that intrigued me was in the way the algorithm was scalable from 3×3 to 9×9. That made it easy to learn.

### Pi

I am Paul King, a math and science teacher. I help maintain the MIT FAQ Archive along with Nick Bolach. I am also the maintainer of a FAQ the archive.