The writers of The Simpsons are so fascinated by mathematics that they have drip-fed morsels of number theory into the series over the last twenty-five years – so many that they could form the basis of an entire university course. The author of The Codebook and Fermat’s Last Theorem uses specific episodes to explain concepts ranging from pi and the paradox of infinity to the origins of numbers.