The Lo Shu magic square: every row, column and diagonal sums to 15

Magic Squares: One Answer, Then 880

Quick answer: a magic square is a grid of numbers where every row, column and diagonal sums to the same total. There is exactly one 3 by 3 magic square once rotations and reflections are set aside, and 880 of order four. Albrecht Durer hid the year 1514 inside one of them.

Best for: anyone who likes the moment a puzzle turns out to have exactly one answer in the whole universe.

Most puzzles have a solution. Magic squares have a census, and the numbers in it are strange enough to have kept mathematicians busy for a very long time.

What Is a Magic Square?

An n by n grid containing each whole number from 1 to n squared exactly once, arranged so every row, every column and both main diagonals add to the same value.

That value is not a matter of choice. For an n by n square it must be n(n² + 1) / 2, because the total of all the numbers is fixed and the rows share it equally. For order three that gives 15; for order four, 34.

Knowing the target before you start is what separates this from most puzzles. You are not searching for an answer, you are searching for an arrangement that hits a number you already know.

Why Is There Only One 3x3 Magic Square?

Because the constraints leave no room.

The 3 by 3 case is called the Lo Shu square, and it is traditionally attributed to ancient China, where legend has it appearing on the shell of a turtle emerging from the River Luo. The dating is traditional rather than documented, so treat the usual "five thousand years old" with the same caution as the tangram's invented antiquity.

What is not in doubt is the mathematics. There is exactly one normal 3 by 3 magic square. Every version you have ever seen is that same square rotated or reflected, which gives eight appearances of one object.

The centre must be 5, and that falls out of the arithmetic rather than being chosen: the centre cell appears in four of the eight lines that must each total 15, and only 5 makes the sums work. Once the centre is fixed, almost everything else follows.

How Many 4x4 Magic Squares Are There?

880. From one to 880 in a single step of size, which is the jump that makes the subject interesting.

That enumeration is due to Bernard Frenicle de Bessy, whose work listing all 880 appeared in 1693, published roughly twenty years after his death. He did it without a computer, by systematic classification, and the count has stood ever since.

The growth continues to be brutal. Order five runs to hundreds of millions, and no exact count is known for order six.

What Is the Durer Magic Square?

The most famous one, and the cleverest piece of showing off in the history of the subject.

Albrecht Durer's engraving Melencolia I, made in 1514, includes a 4 by 4 magic square in the upper right. It is generally considered the first magic square published in Europe.

Every row, column and diagonal totals 34, as it must. So do the four quadrants, the four corners, and the four central cells, which is not required and is the mark of a carefully chosen example rather than any old valid square.

And the two middle cells of the bottom row read 15 and 14. The date of the engraving, placed inside a structure that could not be altered to accommodate it without breaking everything else.

What Other Kinds Are There?

Several, and they exist because mathematicians could not leave the idea alone once the basic version was exhausted.

A panmagic or diabolic square adds the broken diagonals: not just the two main ones but every wrapped diagonal also sums correctly. A bimagic square stays magic when every entry is squared, which is a far heavier condition than it sounds. Magic cubes take the idea into three dimensions, with rows, columns, pillars and space diagonals all summing alike.

Durer's square is close to this territory without quite entering it: its quadrants, corners and centre all give 34 on top of the required lines, which is extra structure deliberately chosen rather than an accident of a valid arrangement.

How Do You Build a Magic Square?

For odd sizes there is a method that always works, and it is almost embarrassingly simple.

Start with 1 in the middle of the top row.

Move up one and right one, and place the next number. If that takes you off the top, wrap to the bottom of the same column. If it takes you off the right, wrap to the left of the same row.

If the cell is already occupied, drop one square directly below your last number instead, and carry on.

That is the entire algorithm for every odd order, and it is worth doing once by hand because watching a 5 by 5 assemble itself is more convincing than being told it works. Even orders need different methods, and order four has its own neat construction.

Are Magic Squares Mechanical Puzzles?

Not strictly, and it is worth being honest about the boundary.

A magic square is a mathematical object, and most people meet it on paper. There are physical versions with sliding or rotating tiles, which pushes them toward the combination family described in the guide to mechanical puzzles, but the puzzle is arithmetic wearing an object rather than the other way round.

The family it genuinely belongs to is the one that runs through pentominoes, the Stomachion and the Soma Cube: puzzles where the real question is how many solutions exist, and the answer turns out to be a specific, countable, surprising number.

We make none of these. What we make is in mechanical puzzles, and the closest thing in spirit is Cube Alchemy, where the same seven pieces produce 240 solutions to one problem and a booklet of further shapes.

Frequently Asked Questions

What is a magic square?

A square grid using each number from 1 to n squared once, where every row, column and both diagonals add to the same total. That total is fixed by the size: n(n² + 1) / 2, which is 15 for a 3 by 3 and 34 for a 4 by 4.

How many 3x3 magic squares are there?

Exactly one, known as the Lo Shu square. The eight versions people see are all that single square rotated or reflected. The centre must be 5, which follows from the arithmetic rather than being a choice.

How many 4x4 magic squares are there?

880, enumerated by Bernard Frenicle de Bessy in work published in 1693, around twenty years after his death, and done entirely by hand. Order five runs to hundreds of millions and order six has no known exact count.

What is hidden in Durer's magic square?

The date. The two middle cells of the bottom row read 15 and 14, giving 1514, the year of the engraving Melencolia I. The square also has its quadrants, corners and centre cells each summing to 34, which is not required of a magic square.

How do you make a magic square?

For any odd size: put 1 in the middle of the top row, then repeatedly move up one and right one, wrapping around the edges. If the target cell is taken, drop one square below your last entry instead. Even sizes need different constructions.

Back to blog