Season 10 Episode 5

OOMC Season 10 Episode 5

Ayliean presents a spell-binding episode with everything you ever wanted to know about magic squares.

Watch on YouTube

 

Further Reading

Challenges

How many ways can you make 15 using three different whole numbers from 1 to 9?

You can find an image of Dürer’s Melencolia I, including magic square, on Wikimedia Commons. Make a list of all the ways you can find to make the magic total of 34 from that magic square.

Explore Knight’s Tours here. Can you visit every square on an 8x8 chess board?

Read more about magic squares and try some challenges with NRICH here.

 

History of Mathematics

You can read about Évariste Galois here and André Weil here. Both links are to the excellent MacTutor web resource.

 

How many magic squares?

At some point in the episode, I claimed that there’s “only one” normal 3x3 magic square, meaning only one way to make a magic square with the numbers 1 to 9, not counting reflections or rotations as different magic squares. You might like to investigate whether this is true or not!

Forgetting the “normal” restriction now (so we can use any nine numbers), we also talked about the system of equations that you’d get by requiring each row and column and the diagonals to sum to the same thing. We thought that maybe this would be 8 equations for nine unknowns. But that’s not quite right, for two reasons. Firstly, the “magic total” is another unknown. And secondly, the equations aren’t independent.

To see this second fact, imagine that you’ve checked that each column sums to the same magic total $M$, and you’ve checked that each of the first two rows also sum to $M$. Then you can deduce that the third row must sum to the same magic total, because you know (from the columns) that the overall sum is $3M$, and you’ve just checked that the first two rows sum to $2M$. So the equation for the last row is redundant; if the other seven equations hold, then that one has to hold too.

We’ve therefore got seven independent equations (not including the last row) and ten unknowns (including the magic total $M$). We might expect “three degrees of freedom” for our magic squares. Ayliean gave us a hint during the episode of how we might realise those three degrees of freedom (the part where we constructed our own magic square, but I think we made a calculation error somewhere!)

 

Linearity of magic

If you have two 3x3 magic squares, then you can add them together to get a magic square. Or you could multiply all the numbers in one of them by a constant, and that gives a magic square too.

I called this “linearity of magic” in the episode as a reference to the phrase “linearity of expectation” from Statistics!

 

Magic squares with primes

In the episode I mentioned the Green-Tao theorem; the primes contain arbitrarily long arithmetic progressions. This was proved in 2004 by Ben Green (now a professor here at Oxford) and Terence Tao (now a professor at UCLA and a Fields Medallist). There’s a Wikipedia page here and the paper is here (I'm not linking to this in the expectation that you’ll read and understand it, but I thought that you might like to see what modern mathematics research papers can look like. Maybe more words than you would guess?)

As a result, any magic square containing whole numbers can be converted into a magic square containing prime numbers. Take the largest number in the magic square, find an arithmetic progression of that length in the primes with $p_n=An+B$ for some $A$ and $B$, say, and replace each number $k$ in the magic square with $Ak+B$. By linearity of magic, this gives a new magic square consisting of primes.

Some of the magic squares we saw in the episode used consecutive primes though, and the Green-Tao theorem doesn't help us there!

 

If you want to get in touch with us about any of the mathematics in the video or the further reading, feel free to email us on oomc [at] maths.ox.ac.uk.  

 

Last updated on 5 Jun 2025, 12:46pm. Please contact us with feedback and comments about this page.