T TestsWorld
Lesson 6 of 10 Grids and magic squares ⏱ 5 min

Building a magic square

🤔
Think first
There are 3,62,880 ways to fill the grid. How can we find a magic one without trying them all?
🎯 In this lesson you'll learn
  • ✓Reason out the magic sum and centre
  • ✓Build the 3 × 3 magic square

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).

816357492magic sum = 45 ÷ 3 = 15centre = 51 and 9 in middle edgesdiagonals: 8 + 5 + 2 = 15and 6 + 5 + 4 = 15

Tap the diagram to enlarge it

The only 1–9 magic square: every line adds to 15 and 5 sits in the centre.
📌 Remember these
  1. Magic sum = 15
  2. Centre = 5
  3. 1 and 9 on middle edges
✅ Quick check
← →