I've recently seen a video of Numberphille channel on Youtube about Fermat's Last Theorem. It talks about how there is a given "solution" for the Fermat's Last Theorem for $n>2$ in the animated series The Simpsons.

Thanks to Andrew Wiles, we all know that's impossible. The host tells that the solution that appears in the episode is actually a near miss.

There are two near-miss solutions and they are:

$$3987^{12} + 4365^{12} \stackrel{?}{=} 4472^{12}$$

$$1782^{12} + 1841^{12} \stackrel{?}{=} 1922^{12}$$

Anyone who knows modular arithmetic can check that those solutions are wrong, even without a calculator. You can check that $87^{12} \equiv 81 \pmod{100}$ and $65^{12} \equiv 25 \pmod {100}$, while $72^{12} \equiv 16 \pmod {100}$. So we have: $$ 81 + 25 \stackrel{?}{\equiv} 16 \pmod {100} $$ $$ 106 \stackrel{?}{\equiv} 16 \pmod {100} $$ which is obviously wrong.

For the second example it's even easier. We know that LHS is an addition of an even and odd number, and the RHS is even number, which is impossible, because we know that the addition of an even and an odd number will provide an odd number.

But what's made me most interested in this is the following. Using a calculator I expanded the equations and I get:

$$3987^{12} + 4365^{12} \stackrel{?}{=} 4472^{12}$$

$$63976656349698612616236230953154487896987106 \stackrel{?}{=} 63976656348486725806862358322168575784124416$$

$$1211886809373872630985912112862690 \stackrel{?}{=} 0$$

And you'll immediately conclude that those numbers aren't even close, their difference is a 33-digit number. But bearing in mind that we are working with really, really big numbers, it's probably better to take relative difference. So we really want to find the ratio of LHS and RHS: $$ \frac{63976656349698612616236230953154487896987106}{63976656348486725806862358322168575784124416} \approx 1.00000000002 $$ Somehow that's impressive, but if take a look into the second example the things start to get more interesting:

$$ 1782^{12} + 1841^{12} \stackrel{?}{=} 1922^{12} $$ $$ 2541210258614589176288669958142428526657 \stackrel{?}{=} 2541210259314801410819278649643651567616 $$

As we can see the first 9 digits are exactly the same and the apsolute difference is: $700212234530608691501223040959$. But if we take a relative difference or ratio we'll get: $$ \frac{2541210258614589176288669958142428526657}{2541210259314801410819278649643651567616} \approx 0.9999999997244572 $$ And this is pretty amazing, because if we make comparison using smaller number this is the same as comparing $10\, 000\, 000\, 000$ and $10\, 000\, 000\, 001$

Probably there are many more, probably infinite amount of such "close" examples, but are there any known examples? Is there any list of them?

And as user17762 commented it would be nice to find a bound $\phi(n) = \inf\{\left| x^n + y^n - z^n\right| : x,y,z \in \mathbb{Z}\}$, although I would be more interested in finding the ratio bound, such that the ratio is closer to $1$

Also as user17762 pointed Taxicab can be used to provide a really close examples for $n=3$, but what about other values for $n$?

  • 5
    $\begingroup$ An interesting question would be a bound for $\phi(n) = \inf \{\vert x^n+y^n - z^n \vert: x,y,z \in \mathbb{Z}\}$ for each $n$. And there is a really close one for $n=3$, $10^3 + 9^3 = 12^3 + 1$, which means $\phi(3) = 1$. $\endgroup$
    – user17762
    Oct 14, 2013 at 21:19
  • 2
    $\begingroup$ That would be a more scientific way of asking, while mine is more like trivial. Also it would be better to use ratio, because for example $x=y=z=1$, would always give a difference of $1$, but obviously we aren't interested in that. Note that in this example the ratios is $2$. $\endgroup$
    – Stefan4024
    Oct 14, 2013 at 21:25
  • 3
    $\begingroup$ You miscalculated the first example. Looks like you typed 4465 instead of 4365. In actuality it's a very good approximation. $\endgroup$
    – Erick Wong
    Jan 5, 2014 at 6:55
  • 1
    $\begingroup$ How do you feel about Pythagorean-triple near misses? $540^2+360^2\cong 648.99922958\ldots$. And $540^2+360^2+1^2=649^2$. ${}\qquad{}$ $\endgroup$ Jun 25, 2014 at 18:46
  • 4
    $\begingroup$ A quicker way to dispatch with $3987^{12} + 4365^{12} = 4472^{12}$ is to work mod $4$, rather than mod $100$: $3987^{12} + 4365^{12}\equiv1+1=2$ mod $4$, while $4472^{12}\equiv0$. $\endgroup$ Nov 9, 2016 at 21:49

5 Answers 5


The following shows that for $n=3$ the ratio can be as close to $1$ as we like. For any positive integer $m$ let:

$a = 3m^3 + 3m^2 + 2m + 1$

$b = 3m^3 + 3m^2 + 2m$

$c = 3m^2 + 2m + 1$

$d = m$

Then it is readily shown that $a^3 = b^3 + c^3 + d^3$. If we focus on the 'wrong solution' $a^3 = b^3 + c^3$, the ratio of LHS to RHS is:


Since $a$ increases much faster than $d$ as $m$ is increased, we can make the ratio as close to $1$ as we like by choosing a sufficiently large value of $m$. With $m=10$, for example, we have:

$$\frac{a^3}{b^3+c^3} = \frac{3321^3}{3320^3+321^3} = \frac{36627445161}{36594368000+33076161}=1.0000000273$$


Noam Elkies gave many examples, as the output of a very fast algorithm for finding almost-solutions to arbitrary 3-variable homogeneous equations, in


The table on page 15 lists 37 examples for Fermat's Last Theorem with exponent between $4$ and $20$. Elsewhere in the article there are near-solutions of $x^\pi + y^\pi = z^\pi$ and many other interesting things.


There are "almost" solutions of $a^3+b^3=c^3.$ If $3$ does not divide $a+b,$ and $a+b$ is factored out of $a^3+b^3,$ you get the equation $a^2-ab+b^2=T^3$ and there are solutions of this equation. What's interesting is that Furtwangler's and Vandiver's theorems (from the classical approach to FLT) are still applicable.


It is believed that $a^3 + b^3 = c^3 + k$ has solutions in positive integers a, b and c except when k = 0 (part of FLT, and very non-trivial proof by Gauss if I'm right) or k = 4 (modulo 9) or k = 5 (modulo 9), which are both trivial.

On the other hand, for many k, even quite small ones, it is very hard to find solutions, and solutions might never be found for some small k.

  • $\begingroup$ I think Euler first proved the $n=3$ case of FLT (i.e. $k=0$ here). Gauss did $n=5$, apparently, among other people. $\endgroup$ Oct 19, 2020 at 3:11

$$ \begin{align} & 360^2+540^2 \approx (648.99922958\ldots)^2 \\[10pt] & 360^2+540^2 + 1^2 = 649^2 \end{align} $$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .