I'm planning a challenge over on Code Golf.SE about integers $a, b, c \ge 0$ such that

$$a^n + b^n = c^n \pm 1$$

for a given integer $n > 2$. However, I'm interested in whether any non-trivial solutions to this exist for a given $n$. Here, I'm defining "non-trivial" solutions as triples $a, b, c$ such all three are unique and non-zero (i.e. to avoid $(a, 1, a)$ and $(a, 0, a)$, and related triples).

I've found this question which asks a related (and broader) question about the existence of such triples, and the accepted answer states

I think that if $n\ge5$ (and assuming the ABCD conjecture), then for any $k$, the equation $$ a^n + b^n - c^n = k $$ has only finitely many solutions $a,b,c\in\mathbb{Z}$ with $|a|,|b|,|c|$ distinct and non-zero.

However, this doesn't fully state whether there are a non-zero number of distinct, non-zero solutions.

This is a program which attempts to find such triples, with $0 \le a, b, c \le 100$, given an input $n$, but so far it hasn't found any for either $n = 4$ or $n = 5$, and it times out if you increase the upper limit by any significant amount.

Therefore, my question is:

  • Can it be shown that, for all integers $n > 2$, the equation $a^n + b^n = c^n \pm 1$ has at least 1 non-trivial solution, for $a, b, c \ge 0$?
  • If not, does expanding the range for $a, b, c$ to $\mathbb{Z}$ affect or change this?
  • 9
    $\begingroup$ What kind of weird messed-up language is your example written in? We're not on CodeGolf here, readability isn't considered a defect. $\endgroup$ Nov 26, 2020 at 17:11
  • 2
    $\begingroup$ For $n = 4$ there are no solutions with $a, b \le 10^4$. I strongly suspect there are no solutions at all. (The folks at CodeGolf might be a bit unhappy if you challenge them to find an object which doesn't exist.) $\endgroup$ Nov 26, 2020 at 18:13
  • 3
    $\begingroup$ Did you follow the links at that older question, card? In particular, the link to Noam Elkies' computations? $\endgroup$ Nov 26, 2020 at 22:24
  • 1
    $\begingroup$ I think it's worth digging in, to get some idea of how unlikely one is to find any non-trivial examples of $a^n+b^n=c^n\pm1$ for $n\ge4$. $\endgroup$ Nov 26, 2020 at 22:42
  • 1
    $\begingroup$ @JohnD.Cook The first line of the linked answer: “ A 4-variable version of the infamous ABC Conjecture says the following:” $\endgroup$ Nov 29, 2020 at 13:39

2 Answers 2


[EDITED] It is likely that there are no solutions at all for $n \ge 4$. For $n \ge 5$ a solution would be a counterexample to the Lander, Parkin, and Selfridge conjecture. The best FLT "near miss" that I know of is $13^5 + 16^5 = 17^5 + 12$.

  • 1
    $\begingroup$ "It is likely that there are no solutions at all." For $n \geq 4$, that is. For $10^3+9^3-12^3=1000+729-1728=1$. $\endgroup$
    – Joël
    Nov 29, 2020 at 2:39
  • $\begingroup$ Yes, I meant for $n \ge 4$. As Zhi-Wei Sun noted, there are infinitely many solutions for $n=3$. Editing. $\endgroup$ Nov 30, 2020 at 6:17

In a message "A conjecture related to Fermat's Last Theorem" sent to Number Theory List on Sep. 26, 2015, I wrote the following:

In 1936 K. Mahler discovered that $$(9t^3+1)^3 + (9t^4)^3 - (9t^4+3t)^3 = 1.$$ Clearly, $$|1^n+1^n-2^n| = 2^n-2\ \mbox{for every}\ n = 4,5,6,\ldots$$ and $$13^5+16^5-17^5 = 371293+1048576-1419857 = 12 < 2^5-2.$$

Here I report my following conjecture which can be viewed as a further refinement of Fermat's Last Theorem.

CONJECTURE (Sept. 24-25, 2015). (i) For any integers $n > 3$ and $x,y,z > 0$ with $\{x,y\}\not= \{1,z\}$, we have $$|x^n+y^n-z^n|\ge2^n-2,$$

unless $n = 5$, $\{x,y\} = \{13,16\}$ and $z = 17$.

(ii) For any integers $n > 3$ and $x,y,z > 0$ with $z\not\in\{x,y\}$, there is a prime $p$ with $$x^n+y^n < p < z^n\ \ \mbox{or}\ \ z^n < p < x^n+y^n, $$

unless $n = 5$, $\{x,y\} = \{13,16\}$ and $z = 17$.

(iii) For any integers $n > 3$, $x > y \ge0$ and $z > 0$ with $x\not=z$, there always exists a prime $p$ with
$$x^n-y^n < p < z^n\ \ \mbox{or}\ \ z^n < p < x^n-y^n. $$

I have checked this new conjecture via Mathematica. For example, I have verified part (i) of the conjecture for $n = 4,\ldots,10$ and $x,y,z=1,\ldots,1700$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.