So close, yet never equal
Fermat’s Last Theorem says that xn + yn = zn has no whole-number solutions once n is 3 or more. It was proved in 1995. But the numbers can come astonishingly close.
9³ = 729
Off by exactly 1. With n = 2 there are perfect matches, such as 3² + 4² = 5². For n = 3 and up, none exist.
Try it yourself
How close does it get as the numbers grow?
Each dot is the best miss found at that z, over every x ≤ y < z. The amber line is the record so far.
Closest misses in this range
Why the misses get closer
Relative error is the gap divided by the size of the numbers. It shrinks because there are more combinations to choose from. At a given z there are about z² pairs (x, y), so the best one lands within roughly 1 part in z² of the target. Even a random pair is already close, because neighbouring n-th powers are only about n/z apart in relative terms.
Absolute error tells a different story. For n = 3 the gap can stay tiny forever: for every whole number t, (9t⁴ − 3t)³ + (9t³ − 1)³ is exactly 1 less than (9t⁴)³. For n = 4 and higher, small absolute gaps almost never appear once the numbers are large.
None of this means a true solution is hiding nearby. Closeness is cheap. Equality is what the theorem rules out.