×11
Mathemagic

Level 2 · Performance Magic

Instant Magic Squares

Someone calls out a number. You fill a 4×4 grid instantly. Every row, column, and diagonal sums to their number. It looks impossible — and it's completely mathematical.


What Is a Magic Square?

A magic square is a grid of distinct numbers where every row, every column, and both main diagonals all add up to the same value — called the magic sum. The smallest non-trivial magic square is 3×3 (with a fixed structure), but 4×4 magic squares allow a parametric family that can be constructed for any target sum.

How to Perform It

  1. Ask the audience for any number greater than 34.
  2. Draw a 4×4 grid on the board.
  3. Fill in the 16 cells using the algorithm — it takes about 20 seconds with practice.
  4. Invite volunteers to check any row, column, or diagonal.

The Algorithm (for target N)

  1. Start from the Frénicle base square (magic sum = 34).
  2. Compute d = N − 34. Set base = d ÷ 4 (round down), rem = d mod 4.
  3. Add base to every cell in the grid.
  4. Apply rem diagonal patches: each adds 1 to exactly one cell per row, column, and diagonal.

Why It Works

Adding a constant to every cell increases every line sum by exactly 4 times that constant (since each line has 4 cells). The "diagonal patches" are carefully chosen transversals: each contains exactly one cell per row, one per column, and one on each main diagonal, so applying a patch increases every line sum by exactly 1. By combining base shifts and patch applications, we can reach any target sum N ≥ 35.

💡 Performance Tip

With practice, you can fill the grid by computing each cell mentally using the formula. But even reading from the sandbox is impressive if you do it smoothly — the audience sees the result, not the method.

Try It Yourself

Interactive Sandbox

Instant Magic Squares

Hover any cell to highlight its row, column, and diagonals — all summing to your number.

Enter any whole number greater than 34 to generate your personal magic square.

Practice offline

Free Worksheet — Instant Magic Squares

8 blank 4×4 grids with target sums for students to fill in, plus 4 completed examples to study. Includes the algebraic explanation for advanced students.

  • 20 graded practice problems
  • Step-by-step answer key
  • Student reference card (wallet size)
  • A4 and US Letter formats
Download Free Worksheet (PDF)

Free. No account required.