The Simpsons reference that refutes one of history’s greatest mathematicians | Scientific American
April 28, 2026
4 min read
Add Us On GoogleAdd SciAm
The Simpsons reference that refutes one of history’s greatest mathematicians
In one famous episode of The Simpsons, Homer finds a counterexample to Fermat’s last theorem
By Manon Bischoff edited by Daisy Yuhas
Homer refuting Fermat’s last theorem in “The Wizard of Evergreen Terrace.”
Disney+
Love math? Sign up for our weekly newsletter Proof PositiveEnter your email
I agree my information will be processed in accordance with the Scientific American and Springer Nature Limited Privacy Policy. We leverage third party services to both verify and deliver email. By providing your email address, you also consent to having the email address shared with third parties for those purposes.
Sign Up
This article is from Proof Positive, our friendly newsletter that explores the joys and peculiarities of math. Sign up today for a weekly math essay and puzzle in your email inbox.
The plot of “The Wizard of Evergreen Terrace” seems like that of a typical Simpsons episode. In it, Homer struggles with a midlife crisis. Disappointed by a lack of accomplishments in his life, he decides to emulate famous inventor Thomas Edison and in turn tries to develop technical innovations, which of course all end in disaster. But if you follow the episode carefully, which was first broadcast in 1998, you’ll be in for a surprise—at least if you know anything about mathematics.
On supporting science journalism
If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.
In one particular scene, Homer stands pensively at a fully scribbled blackboard. Next to the obligatory drawings of doughnuts, which are not only Homer’s favorite food but also critical to the field of topology, there is a seemingly harmless equation: 3,98712 + 4,36512 = 4,47212. Type it into a calculator and it appears correct. But amazingly, it contradicts one of the most established theorems of mathematics.
The Great Theorem of Fermat: A Centuries-Old Mathematical Riddle
This story dates back to the 17th century. It starts with the equation xn + yn = zn. If you choose n = 1, then this equation will always be satisfied: no matter how one chooses the values for x and y, z will always be a positiveinteger result. For example, 3 + 6 = 9.
For n = 2, it gets a bit trickier because the equation becomes quadratic: x2+ y2 = z2. This formulation feels familiar, particularly if you like geometry—it’s the Pythagorean theorem. Still, there are some quirks: if x and yhave integer values, z is not necessarily an integer. For example, for x = 1 and y = 2, the formula 12 + 22 = 5. But 5 is not a square number.
Look at the equation again when n = 3 and things get strange. You cannot find a solution that is an integer for x3 + y3 = z3. That means you cannot divide a cube with integer side lengths z into two smaller cubes that have integer side lengths x and y. The same is true for all other values of n.
Seventeenth-century French scholar Pierre de Fermat recognized this, too—and claimed to have discovered a proof for the statement that there are no three positive integers x, y and z that can satisfy xn + yn = zn when n is greater than 2. The catch: he wrote about achieving this mathematical wizardry in a note in the margins of a book by an ancient scientist, Diophantus of Alexandria, and he didn’t actually spell out the proof.
Fermat left similar scribbles behind frequently. And all of them—except this one—were successfully proved by later experts. So this mystery proofbecame known as Fermat’s last theorem.
Generations of scholars took a crack at it until finally, more than 350 years later, in 1994, mathematician Andrew Wiles solved the puzzle. His impressive work made waves: he developed novel methods that led to further groundbreaking discoveries in the field. For this, among other things, he was honored in 2016 with the Abel Prize, one of the highest honors in mathematics.
For Wiles’s proof, you have to leave the algebra you know from school and enter more branched mathematical areas. In fact, you have to enter into the esoteric realms of elliptic curves and modular forms—concepts developed in the 1980s.
Nobody seriously doubts that Wiles’s approach is correct. His technical paper has been reviewed by many experts, especially because some of his techniques are repeatedly revisited to reveal other mathematical relationships. This reduces the probability that an error could have crept in somewhere.
But Fermat could not have known about elliptic curves and modular forms. So that creates new questions: Had the scholar been joking? Had he miscalculated? Or does a substantially simpler proof exist? The debate goes on.