The Story of Fermat’s Last Theorem, Part 1

By Zhenyi Tan

So it seems like the Riemann hypothesis is probably solved by AI. Oh well. When AI started solving math problems, I panicked. Now that the final boss is down I’m more like whatever, I don’t care. I keep thinking, fortunately Fermat’s Last Theorem was proved by humans. And I want to talk about this very human story.

(The usual disclaimer: I have no math background. I am an idiot and I don’t know what I’m talking about. You won’t be able to prove FLT yourself after reading this series.)

This is a story about standing on the shoulders of giants. And giants standing on the shoulders of other giants like some sort of cheerleading routine. In this series, we’ll meet more giants than Attack on Titan.

One of these early giants is Pythagoras. He’s the reason1 why you had to learn about 32 + 42 = 52 in school. There are other numbers too, like 52 + 122 = 132. In fact, there are infinitely many of these x2 + y2 = z2 number trios.

People later discovered that these number trios are related to points on a circle2. And there’s a formula to generate them:

x = a2 − b2
y = 2 × a × b
z = a2 + b2

You plug in a = 2, b = 1 and you get 3, 4, 5. Plug in a = 3, b = 2 and you get 5, 12, 13.

2000 years later, a lawyer named Pierre de Fermat looked at this… wait, what? Lawyer? Yeah, turns out, Fermat wasn’t a professional mathematician. He just did math for fun. His hobby was nerd-sniping actual mathematicians by showing them interesting facts but not including the proof. In one such nerd-sniping attempt, he accidentally helped Blaise Pascal invent probability theory.

Anyway, Fermat looked at x2 + y2 = z2 and thought, what about x3 + y3 = z3? He tried a bunch of numbers and none of them worked. What about x4 + y4 = z4? x5 + y5 = z5? He wasted so many hours testing numbers. In the end he got frustrated and wrote:

xn + yn = zn has no solutions in positive whole3 numbers when n is bigger than 2. I know how to prove this but I’m not telling you. (The proof is truly marvelous btw.) Because this piece of paper is too small and your brains are too small.

Contrary to popular belief, he didn’t just write // TODO: fix later and walk away. He did prove 1 special case where n = 4. The gist of it is, suppose x4 + y4 = z4 is true. You can use the Pythagorean triples formula above to derive a smaller set of positive whole numbers where smallx4 + smally4 = smallz4 is also true. This is problematic because you can keep going and find smaller and smaller solutions. But eventually you’d reach numbers smaller than 1, which aren’t positive whole numbers. Therefore x4 + y4 = z4 does not have a solution.

Then Fermat refused to elaborate and died. This problem became his ultimate nerd-snipe for the next 350 years.


  1. The Babylonians knew about the triangle thing 1000 years before Pythagoras was born. But for some reason we still call it Pythagoras’s theorem. ↩

  2. You can also write x2 + y2 = z2 as (x/z)2 + (y/z)2 = 1. ↩

  3. The numbers have to be positive whole numbers. When I was little I used to tell my math teacher I’d solved Fermat by showing her 13 + (-1)3 = 03. She wasn’t impressed. ↩