A magic square has every row, every column and both diagonals adding to the same number, the magic sum. There are 3,62,880 ways to fill a 3 × 3 grid with 1–9, so we reason instead of guessing.
Observation 1: the magic sum is 15. The three rows add to 45 and are equal, so each is 45 ÷ 3 = 15.
Observation 2: the centre is 5. If 9 were in the centre, 8 would share a line with it, needing 8 + 9 + something = 15: impossible. If 1 were in the centre, 2 would share a line, needing 15 − 3 = 12: impossible. Similar reasoning rules out everything except 5.
Observation 3: 1 and 9 go in middle edge positions, not corners. A corner lies on three lines (a row, a column and a diagonal), so 1 in a corner needs three different pairs adding to 14 with numbers 2–9; only 5 + 9 and 6 + 8 exist.
Put 1 and 9 opposite each other through the centre (1, 5, 9) and fill the rest:
| 8 | 1 | 6 |
|---|---|---|
| 3 | 5 | 7 |
| 4 | 9 | 2 |
Apart from rotations and reflections, this is the only 3 × 3 magic square using 1–9. Adding 1 to every number gives a magic square with 2–10 (sum 18); doubling every number doubles the magic sum (30).
Tap the diagram to enlarge it
- Magic sum = 15
- Centre = 5
- 1 and 9 on middle edges