How to play Magic Square
- A magic square is a grid of numbers in which every row, every column and both diagonals add up to the same total, called the magic sum. The 3×3 square uses each of the numbers 1 to 9 once, 4×4 uses 1 to 16, and 5×5 uses 1 to 25.
- Tap a square to select it, then tap a number to put it there. Numbers you have already used are faded; tapping one moves it to the selected square. On a computer you can also type numbers and use the arrow keys and Delete.
- Turn on “Notes” to pencil possible numbers into a square in small type (tap a number again to remove it). When you place a number, it disappears from the notes in other squares. On a computer, press N to switch notes on and off.
- The total of each row is shown on the right, each column below, and the two diagonals in the bottom corners. A line that reaches the magic sum gets a ✓. When every line has a ✓, the square is solved.
- 3×3 starts from an empty grid: the classic puzzle. 4×4 and 5×5 start with some numbers already in place, and each has exactly one solution. Stuck? “Hint” fills in the square that is easiest to work out next (puzzles solved with hints don’t count toward your best time).
- The daily puzzles, one 4×4 and one 5×5, are the same for everyone and change once a day. Solve at least one each day to build a streak.
What is a magic square?
A magic square is a square grid filled with the numbers 1 to n² (where n is the number of squares along each side) so that the numbers in each row, each column and both main diagonals add up to the same number. That number is the magic sum, also called the magic constant. It is the total of 1 to n² shared equally among the n rows, which works out to n(n² + 1) ÷ 2.
| Size | Numbers | Magic sum |
|---|---|---|
| 3×3 | 1–9 | 15 |
| 4×4 | 1–16 | 34 |
| 5×5 | 1–25 | 65 |
| 6×6 | 1–36 | 111 |
| 7×7 | 1–49 | 175 |
If rotations and reflections of the same square count as one, there is exactly 1 magic square of size 3×3, there are 880 of size 4×4, and about 275 million of size 5×5.
How to solve a magic square
Start with the magic sum (15 for 3×3). The center of a 3×3 is always the magic sum ÷ 3, which is 5 for 1 to 9. Then look for a line with only one empty square and subtract the numbers already in it from the magic sum. 4×4 and 5×5 work the same way, and for a line with two empty squares, think about which pairs of unused numbers make up the difference.
How to make a magic square
Odd sizes (3×3, 5×5, 7×7…)
- Put 1 in the middle of the top row.
- Put each new number one square up and one square to the right. If that takes you off the top, go to the bottom row; off the right, go to the left column (think of the top and bottom edges, and the left and right edges, as joined).
- If that square is already filled, put the number directly below the last one instead. Repeat until the grid is full. This works for every odd size.
| 8 | 1 | 6 |
| 3 | 5 | 7 |
| 4 | 9 | 2 |
| 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 |
This is known as the Siamese method, or de la Loubère’s method, after the French diplomat who brought it back from Siam (now Thailand) in the 17th century.
4×4
- Write 1 to 16 in order, left to right and top to bottom.
- Replace each of the 8 numbers on the two diagonals with 17 minus that number (1 becomes 16, 6 becomes 11, and so on). The result is a 4×4 magic square.
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 |
| 16 | 2 | 3 | 13 |
| 5 | 11 | 10 | 8 |
| 9 | 7 | 6 | 12 |
| 4 | 14 | 15 | 1 |
Sizes that are multiples of 4 (8×8, 12×12…) work the same way: write 1 to n² in order, divide the grid into 4×4 blocks, and replace the numbers on each block’s diagonals with n² + 1 minus the number (65 minus the number for 8×8). Even sizes that are not multiples of 4 (6×6, 10×10…) are harder and need another method, such as combining odd squares.
History of magic squares
The oldest known magic square is the Lo Shu, a 3×3 square from Chinese legend that is said to have appeared on the shell of a turtle rising from the Luo River. The German artist Albrecht Dürer put a 4×4 magic square in his 1514 engraving Melencolia I. The two middle numbers of its bottom row, 15 and 14, spell out the year. In Japan, mathematicians of the Edo period such as Seki Takakazu studied how to construct them.