Fermat's Last Theorem
Enter positive integers a, b and an exponent n and compare \(a^{n}+b^{n}\) with \(c^{n}\). For \(n=2\) the equation is Pythagoras and has infinitely many solutions. For every integer n above 2, Fermat's Last Theorem says there are none. The arithmetic is exact, so a gap of 1 is really 1, even when the powers have dozens of digits.
How it works
- Enter a, b and an exponent n of 2 or more, or pick an example.
- Compare the sum with the nearest c, or type a c of your own.
- Read the exact difference, how many leading digits agree, and where the sum sits between the neighboring powers.
The theorem
Fermat's Last Theorem says that \(a^{n}+b^{n}=c^{n}\) has no solutions in positive integers when the exponent n is an integer greater than 2. For \(n=2\) it is Pythagoras, and \(3^{2}+4^{2}=5^{2}\) is the smallest solution.
Pierre de Fermat wrote the claim in 1637 in the margin of his copy of Diophantus, adding that his proof would not fit there. No proof of his for the general case was ever found. Andrew Wiles proved the theorem in 1995.
Near misses
A sum of two powers can land just beside another power. \(9^{3}+10^{3}=1{,}729\) and \(12^{3}=1{,}728\), so the two sides differ by 1. \(13^{5}+16^{5}=1{,}419{,}869\) and \(17^{5}=1{,}419{,}857\), a difference of 12. In The Simpsons, a blackboard shows
\[3{,}987^{12}+4{,}365^{12}=4{,}472^{12}\,.\]
The two sides agree on the first 10 digits, 63,976,656,34…, but the sum is larger by about \(1.21\times 10^{33}\), a relative gap of about \(1.89\times 10^{-11}\). A display that keeps only those 10 digits can round them to the same number. Closeness is not a solution.
Using the app
Enter positive integers a and b and an exponent n, or pick an example. The sum is compared with c to that power. The difference is exact, and your last input is kept in this browser.
Frequently asked questions
Does this prove the theorem?
No. It checks the numbers you enter, with exact integer arithmetic, so a gap of 1 is really 1 and not a rounding error. The proof that no solution exists for any exponent above 2 is Wiles's, from 1995, and it is far beyond what a calculator can do.
Why do squares work when higher powers do not?
For \(n=2\) the equation is Pythagoras, and there are infinitely many solutions. Two integers \(m>k>0\) give \(a=m^{2}-k^{2}\), \(b=2mk\) and \(c=m^{2}+k^{2}\): \(m=2\) and \(k=1\) give 3, 4, 5. No identity of that kind produces positive integers for an exponent above 2. Fermat himself proved \(n=4\), Euler \(n=3\), and Wiles every remaining exponent.
Are my numbers sent anywhere?
No. The powers are calculated in your browser, and your last inputs stay in this browser's local storage.
Is 3987¹² + 4365¹² = 4472¹² true?
No. It is the near-miss from The Simpsons episode The Wizard of Evergreen Terrace: a calculator that shows 10 digits makes both sides look equal, but the exact numbers differ by a 34-digit gap. Choose Simpsons near-miss to see it. Quick check: 3987 and 4365 are multiples of 3, and 4472 is not.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
前往編輯器