Hits: 50

Last time I introduced the idea of magic squares. I promised I would show you how to make one. In this post, I will begin by discussing “trivial” squares, or squares made by simple rules of following diagonals and wrapping.

When I say a square is “magic”, I mean that all rows, columns, and diagonals add up to the same number. While other sources, such as Wolfram’s Mathematica, say that only the main diagonal of the matrix need be magic, I will take the more strict requirement that both leftward and rightward diagonals have to be magic.

There are trivial magic squares that begins by following a rule where you start with “1” in the top middle square, then move up and to the right one square, and place a “2” there.

_ 1 _ _ _ _ _ _ _

But you may have noticed that if you start at the top, how can you move “up and to the right”? You get around this by “wrapping” to the bottom, treating the bottom of the rightward column as though it is above.

_ 1 _ _ _ _ _ _ 2

OK, you say, but now there’s no “right” after the last column. Now what? Now you can wrap so that the leftmost column is treated as “right of” the rightmost column:

_ 1 _ 3 _ _ _ _ 2

Now another problem: up and to the right of “3”, there is a “1” in the way. If this happens, you are allowed to place the fourth number below the “3”:

_ 1 _ 3 _ _ 4 _ 2

Now, following these rules and exceptions, we can keep going:

8 1 6 3 5 7 4 9 2

The result is a magic square whose rows, columns and diagonals add up to 15.

I found that if I moved the 1 elsewhere and followed these rules in the same manner, some or all of the “magic” is lost. There seems to be only one magic square that can be made using these rules, at least one that adds up to 15 in all of its rows, columns and diagonals. The following 3×3 magic squares were the closest I could come to any credible “magic” by placing the “1” in a different position:

6 8 1 4 9 2 7 3 5 and similarly: 8 1 6 2 4 9 3 5 7

But notice in both cases, neither of the diagonals add up to 15. In the next post, I will discuss a way to break this limitation, making it possible to construct up to 36 3×3 magic squares.

Meanwhile, let’s expand the idea to 5×5, using the same, identical rules. This one seems easier in a way, since there aren’t as many blockages early on:

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

I particularly like 5×5 squares. But my experience with placing the “1” elsewhere than the exact middle position of the top row has resulted in a loss of “magic”. However, I was lucky on my first attempt with moving the “1” around. The following magic square has a “Mathematica” level of magic:

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

Later in this series, we can break this limitation, too. But next, we shall discuss some 4×4 magic squares, including one that made history.