Math Lab
Home/Class VI/Ch 3/Magic squares and number puzzles

Magic squares and number puzzles

A magic square is a square grid of numbers in which every row, every column, and both diagonals add to the same total. For more than two thousand years, magic squares have been admired across India, China, and the Arab world for their balance and beauty.

Concept

The smallest interesting magic square is the 3×33 \times 3 magic square using the numbers 11 to 99 exactly once each. The unique arrangement (up to rotations and reflections) is:

276951438\begin{array}{|c|c|c|} \hline 2 & 7 & 6 \\ \hline 9 & 5 & 1 \\ \hline 4 & 3 & 8 \\ \hline \end{array}

Check: every row, column, and diagonal adds to 1515.

  • Rows: 2+7+6=152+7+6 = 15, 9+5+1=159+5+1 = 15, 4+3+8=154+3+8 = 15.
  • Columns: 2+9+4=152+9+4 = 15, 7+5+3=157+5+3 = 15, 6+1+8=156+1+8 = 15.
  • Diagonals: 2+5+8=152+5+8 = 15, 6+5+4=156+5+4 = 15.

The shared total (1515) is called the magic constant. For a 3×33 \times 3 square using 1199, the magic constant must be 1515, because the sum 1+2++9=451+2+\dots+9 = 45, and we are splitting it into 33 equal rows.

For an n×nn \times n magic square using the numbers 11 to n2n^2, the magic constant is

M=n(n2+1)2M = \frac{n(n^2 + 1)}{2}

So for n=4n = 4, M=4×172=34M = \frac{4 \times 17}{2} = 34. For n=5n = 5, M=65M = 65.

Magic squares also work with other sets of numbers. You can build a magic square using consecutive numbers like 10,11,12,,1810, 11, 12, \dots, 18, or with any nine numbers in arithmetic progression. The arrangement is the same , only the entries shift.

There are simple rules of construction for odd-sized magic squares (called the Siamese method), but they are surprisingly hard to invent on your own. Try the 3×33 \times 3 case by hand and you will see why people have stared at these for centuries.

Other number-grid puzzles:

  • Kakuro , fill in digits so that segments sum to given totals.
  • Sudoku , fill in a 9×99 \times 9 grid with 1199 in every row, column, and 3×33 \times 3 block.
  • Cross sums , fill a cross-shape so all arms add to the same total.

The common idea: a grid where number rules connect cells.

Worked examples

Example 1. Verify that the magic constant for a 3×33 \times 3 square using 1199 is 1515.

  • Sum 1+2+3++9=9×102=451 + 2 + 3 + \dots + 9 = \frac{9 \times 10}{2} = 45.
  • Split into 33 equal rows: 45÷3=1545 \div 3 = 15. ✓

Example 2. What is the magic constant for a 5×55 \times 5 magic square using 112525?

  • M=5(25+1)2=5×262=65M = \frac{5(25 + 1)}{2} = \frac{5 \times 26}{2} = 65.

Example 3. Complete this partial magic square (magic constant 1515):

?9?35??1?\begin{array}{|c|c|c|} \hline ? & 9 & ? \\ \hline 3 & 5 & ? \\ \hline ? & 1 & ? \\ \hline \end{array}
  • Middle row sums to 1515: 3+5+?=15?=73 + 5 + ? = 15 \Rightarrow ? = 7. So middle right is 77.
  • Middle column: 9+5+1=159 + 5 + 1 = 15. ✓
  • Top row: ?+9+?=15? + 9 + ? = 15. The corners must sum to 66. From 1199, the available corners are 2,4,6,82, 4, 6, 8.
  • Bottom row: ?+1+?=15? + 1 + ? = 15, corners sum to 1414, so they must be 66 and 88.
  • Left column: top + 33 + bottom = 1515 \Rightarrow top + bottom = 1212. From the corner pool {2,4,6,8}\{2, 4, 6, 8\} with top row pair summing to 66 and bottom pair to 1414: top-left + top-right = 66 and bottom-left + bottom-right = 1414.
  • Try top-left = 22, top-right = 44, bottom-left = 66, bottom-right = 88: check diagonals. 2+5+8=152 + 5 + 8 = 15 ✓; 4+5+6=154 + 5 + 6 = 15 ✓.
  • Final square:
294357618\begin{array}{|c|c|c|} \hline 2 & 9 & 4 \\ \hline 3 & 5 & 7 \\ \hline 6 & 1 & 8 \\ \hline \end{array}

Example 4. Add the same number k=10k = 10 to every entry of the 3×33 \times 3 magic square in Example 3. Is it still a magic square? What is the new magic constant?

  • Every row, column, diagonal gains 3×10=303 \times 10 = 30. New constant =15+30=45= 15 + 30 = 45. Still magic.

Try it yourself

  1. Find the magic constant of a 4×44 \times 4 magic square using 111616.
  2. Make a magic square using 2,3,4,,102, 3, 4, \dots, 10 (instead of 1199). What is the magic constant?
  3. Multiply every entry in a magic square by 33. Is it still magic?
  4. In a 3×33 \times 3 magic square, the centre is always the average of the numbers used. Verify this for 1199.
  5. Sudoku challenge: in a row of a 9×99 \times 9 Sudoku, what must the sum of the digits be?
  6. Tricky: design a 3×33 \times 3 magic square using only odd numbers 1,3,5,7,9,11,13,15,171, 3, 5, 7, 9, 11, 13, 15, 17. What is the constant?
  7. Look up Dürer's famous magic square in his 15141514 engraving Melencolia I. What is its magic constant?

Activity

Build it. On paper, draw a 3×33 \times 3 grid. Use cut paper squares numbered 11 through 99. By trial, find an arrangement where every row, column, and diagonal sums to 1515. You might fail many times before succeeding , that is part of the fun. Once you crack it, try the Siamese method: place 11 in the top middle, then move up-right (wrapping around) to place 2,3,,92, 3, \dots, 9, with the rule that if you land on a filled cell, drop down one. See if you can reach the same square.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Magic squares
6 questions · pick the best answer
Q1

In a magic square, each row, column, and diagonal sums to:

Q2

Standard 3x3 magic square using 1-9 has magic sum:

Q3

Centre cell of a 3x3 magic square (1-9):

Q4

If a 3x3 magic square uses 2-10, magic sum:

Q5

Number of cells in a 4x4 magic square:

Q6

Magic sum of a 4x4 magic square using 1-16: