# Solutions to AN+BN=CN±1A^N+B^N=C^N \pm 1

Is there a solution to $$AN+BN=CN±1A^N+B^N=C^N \pm 1$$ where $$A,B,C,N∈NA,B,C,N\in\Bbb{N}$$, such that $$A,B,C>1,N≥4A,B,C > 1,N \geq 4$$ and $$gcd(A,B)=gcd(B,C)=gcd(A,C)=1gcd(A,B)=gcd(B,C)=gcd(A,C)=1$$?

This question was inspired by this one: $A^X+B^Y=C^Z\pm 1$ Beal’s conjecture “almost” solutions

A related question was asked here before.

Noam Elkies has published a paper on this subject. The table on page 15 of the paper and his extended table here have some interesting results. If I understood his work correctly, there are no solutions for $$4≤N≤204 \leq N \leq 20$$ and $$C<223=8,388,608C < 2^{23}=8,388,608$$.

I also found a MathWorld article on 4th order diophantine equations, but it doesn't cover equations of this form. I also checked that the OEIS has no sequences for such Fermat near misses.

This exact question was a summer research project of mine when I was a second-year undergraduate in 2013. It was inspired by infinitely many solutions parametrized by Ramanujan in the $$n=3n=3$$ case. I didn't make much progress, but I can show you a conditional result that I found, and some slight progress in the even case (with help from Noam Elkies, if I recall correctly). I haven't look at this in 7 years, so please verify independently if the propositions are true.

Abstract. Srinivasa Ramanujan wrote down in his Lost Notebook infinitely many non-trivial examples of integers $$x,y,zx,y,z$$ such that $$x^3+y^3=z^3\pm 1x^3+y^3=z^3\pm 1$$, for each sign. Aside from his miraculous construction, the result itself is remarkable as it shows that the smallest perturbation of Fermat's famed equation of degree $$33$$, which has been known since the time of Euler to have no solutions, has infinitely many solutions. We study the natural generalization $$a^n+b^n=c^n\pm 1a^n+b^n=c^n\pm 1$$, which we call the Fermat-Ramanujan equation.

Definition 1. Let $$x\in\mathbb{Z}x\in\mathbb{Z}$$ be non-zero. Then there exists a unique prime factorization $$x=\pm\prod_{i=1}^{s}{p_i^{e_i}}x=\pm\prod_{i=1}^{s}{p_i^{e_i}}$$, where the $$p_ip_i$$ are distinct ascending primes and the $$e_ie_i$$ are positive integers. Then define, for each $$k\in\mathbb{Z}^+k\in\mathbb{Z}^+$$, the $$kk$$-radical of $$xx$$ to be $$\text{rad}_k (x)=\prod_{i=1}^{s}{p_i^{\min(e_i,k)}}.\text{rad}_k (x)=\prod_{i=1}^{s}{p_i^{\min(e_i,k)}}.$$

Note that for $$k=1k=1$$, this is the classic radical function
$$\text{rad}_1 (x)=\prod_{i=1}^{s}{p_i^{\min(e_i,1)}=\prod_{i=1}^{s}{p_i}}=\text{rad}(x).\text{rad}_1 (x)=\prod_{i=1}^{s}{p_i^{\min(e_i,1)}=\prod_{i=1}^{s}{p_i}}=\text{rad}(x).$$

Hu-Yang Conjecture. Let $$\{a_i\}_{i=0}^{m}\{a_i\}_{i=0}^{m}$$ be integers with $$m\ge 2m\ge 2$$, such that $$\begin{cases} \gcd(a_0,a_1,\ldots, a_m) =1\\ a_1+\cdots+a_m=a_0\end{cases}\begin{cases} \gcd(a_0,a_1,\ldots, a_m) =1\\ a_1+\cdots+a_m=a_0\end{cases}$$ and no subset of $$\{a_1,\ldots,a_m\}\{a_1,\ldots,a_m\}$$ sums to $$00$$. Then, independent of $$\{a_i\}_{i=0}^m\{a_i\}_{i=0}^m$$,
$$\forall \epsilon>0,\exists \kappa >0 : \max_{0\le i\le m}(|a_i|)\le \kappa\cdot \left(\prod_{i=0}^m{\text{rad}_{(m-1)}(a_i)}\right)^{1+\epsilon}. \hspace{1cm} [\textbf{1}]\forall \epsilon>0,\exists \kappa >0 : \max_{0\le i\le m}(|a_i|)\le \kappa\cdot \left(\prod_{i=0}^m{\text{rad}_{(m-1)}(a_i)}\right)^{1+\epsilon}. \hspace{1cm} [\textbf{1}]$$

Corollary. The above conjecture would imply that for every $$\epsilon>0\epsilon>0$$, for all but finitely many such $$\{a_i\}_{i=0}^m\{a_i\}_{i=0}^m$$,
$$\max_{0\le i\le m}(|a_i|)\le \left(\prod_{i=0}^m{\text{rad}_{(m-1)}(a_i)}\right)^{1+\epsilon}.\max_{0\le i\le m}(|a_i|)\le \left(\prod_{i=0}^m{\text{rad}_{(m-1)}(a_i)}\right)^{1+\epsilon}.$$

Lemma 1. We have that
$$\forall x\in\mathbb{Z}, \forall n,k\in\mathbb{Z}^+: n\ge k\implies \text{rad}_k (x^n)=\text{rad}(x)^k.\forall x\in\mathbb{Z}, \forall n,k\in\mathbb{Z}^+: n\ge k\implies \text{rad}_k (x^n)=\text{rad}(x)^k.$$

Proof. Suppose $$x=\pm\prod_{i=1}^{s}{p_i^{e_i}}x=\pm\prod_{i=1}^{s}{p_i^{e_i}}$$ as in the definition, and that $$n,k\in\mathbb{Z}^+: n\ge kn,k\in\mathbb{Z}^+: n\ge k$$. Each $$e_i\ge 1e_i\ge 1$$ so $$ne_i\ge kne_i\ge k$$ and
$$\text{rad}_k (x^n)=\prod_{i=1}^{s}{p_i^{\min(ne_i,k)}}=\prod_{i=1}^{s}{p_i^k}=\left(\prod_{i=1}^{s}{p_i}\right)^k=\text{rad}(x)^k,\text{rad}_k (x^n)=\prod_{i=1}^{s}{p_i^{\min(ne_i,k)}}=\prod_{i=1}^{s}{p_i^k}=\left(\prod_{i=1}^{s}{p_i}\right)^k=\text{rad}(x)^k,$$
as desired.

Proposition 1. Assuming the conjecture:

1. For all sufficiently large $$nn$$, there exist no triples of positive
integers $$a\le b< ca\le b< c$$ such that $$a^n+b^n=c^n+1a^n+b^n=c^n+1$$.
2. If there are infinitely many triples of positive integers $$a\le b< ca\le b< c$$ such that
$$a^n+b^n=c^n+1a^n+b^n=c^n+1$$, then $$n\le 6n\le 6$$.

Proof. Suppose that $$n,a,b,c\in\mathbb{Z}^+n,a,b,c\in\mathbb{Z}^+$$ such that $$a^n+b^n-c^n=1a^n+b^n-c^n=1$$ with $$a\le b< ca\le b< c$$.

Then $$\gcd(a^n,b^n,-c^n,1)=1\gcd(a^n,b^n,-c^n,1)=1$$ and no subset of $$\{a^n,b^n,-c^n\}\{a^n,b^n,-c^n\}$$ sums to $$00$$. By the corollary and the lemma, for all but finitely many such triples $$(a,b,c)(a,b,c)$$,
$$c^n=\max(|a^n|,|b^n|,|-c^n|)\le \left(\text{rad}_2 (a^n)\cdot\text{rad}_2 (b^n)\cdot\text{rad}_2 (c^n)\right)^{1+\epsilon}= (a^2 b^2 c^2)^{1+\epsilon}

Fix any $$\epsilon>0\epsilon>0$$. Then it is clear that for sufficiently large $$nn$$, $$cc$$ does not even exist and so neither does a triple.

If the existence of infinitely many solutions is assumed, a triple with $$c^n exists as there are only finitely many exceptions. Then $$n<6(1+\epsilon)n<6(1+\epsilon)$$, and as this holds for every $$\epsilon>0\epsilon>0$$, we get $$n\le 6n\le 6$$.

Corollary. The exact same proposition and proof holds for the equation $$a^n+b^n=c^n -1a^n+b^n=c^n -1$$.

In order to study the equations for even $$nn$$, we first solve $$a^2+b^2=c^2\pm 1a^2+b^2=c^2\pm 1$$, for each sign.

Lemma 2. The binary quadratic form $$ap^2+bpq+cq^2ap^2+bpq+cq^2$$ is equivalent to

1. $$p^2+q^2p^2+q^2$$ if and only if $$b^2-4ac=-4b^2-4ac=-4$$.
2. $$p^2-q^2p^2-q^2$$ if and only if $$b^2-4ac=4b^2-4ac=4$$ and $$a,ca,c$$ are not both even.

Proposition 2. The integers $$x,y,zx,y,z$$ satisfy $$x^2+y^2=z^2\pm 1x^2+y^2=z^2\pm 1$$, for a fixed sign the opposite of which is $$\mp\mp$$, if and only if there exist integers $$a_1,a_2,b_1,b_2a_1,a_2,b_1,b_2$$ such that
$$\begin{cases} 1=a_1 b_2-a_2b_1\\ 2x=(a_1^2-a_2^2)\mp (b_1^2-b_2^2)\\ y=a_1 a_2\mp b_1 b_2\\ 2z=(a_1^2+a_2^2)\mp (b_1^2+b_2^2) \end{cases}.\begin{cases} 1=a_1 b_2-a_2b_1\\ 2x=(a_1^2-a_2^2)\mp (b_1^2-b_2^2)\\ y=a_1 a_2\mp b_1 b_2\\ 2z=(a_1^2+a_2^2)\mp (b_1^2+b_2^2) \end{cases}.$$

This is under the assumption that if not both of $$x,yx,y$$ are even, then $$xx$$ is odd, which does not compromise generality as $$x,yx,y$$ are symmetric in the equation.

Proof. Suppose $$x,y,z\in\mathbb{Z}x,y,z\in\mathbb{Z}$$ such that $$x^2+y^2=z^2\pm 1x^2+y^2=z^2\pm 1$$, for a fixed sign. Let $$b=yb=y$$ and define $$a,ca,c$$ as
$$\begin{cases}a=z+x\\ c=z-x\end{cases}\iff \begin{cases}2x=a-c\\ 2z=a+c\end{cases}.\begin{cases}a=z+x\\ c=z-x\end{cases}\iff \begin{cases}2x=a-c\\ 2z=a+c\end{cases}.$$

Substituting yields $$\left(\frac{a-c}{2}\right)^2+b^2=\left(\frac{a+c}{2}\right)^2\pm 1\iff b^2-ac=\pm 1.\left(\frac{a-c}{2}\right)^2+b^2=\left(\frac{a+c}{2}\right)^2\pm 1\iff b^2-ac=\pm 1.$$

Then the discriminant of the binary quadratic form $$\phi(p,q)=ap^2+2bpq+cq^2\phi(p,q)=ap^2+2bpq+cq^2$$ is $$D(\phi)=(2b)^2-4ac=4(b^2-ac)=\pm 4D(\phi)=(2b)^2-4ac=4(b^2-ac)=\pm 4$$. If $$D(\phi)=-4D(\phi)=-4$$, then Lemma 2.1 can be immediately applied. If $$D(\phi)=4D(\phi)=4$$, then Lemma 2.2 applies. This is because at least one of $$a,ca,c$$ being odd is equivalent to at least one of $$z,xz,x$$ being odd. If $$zz$$ is odd, we are done. Otherwise, one of $$x,yx,y$$ must be odd and in the proposition we assumed that it is $$xx$$ in this case.

So $$ap^2+2bpq+cq^2ap^2+2bpq+cq^2$$ is equivalent to $$x^2\mp y^2x^2\mp y^2$$. In other words, there exist $$a_1,a_2,b_1,b_2\in\mathbb{Z}a_1,a_2,b_1,b_2\in\mathbb{Z}$$ such that
\begin{align*} ap^2+2bpq+cq^2 &= (a_1 p+a_2 q)^2\mp (b_1 p+ b_2 q)^2\\ &= (a_1^2\mp b_1^2)p^2+2(a_1 a_2 \mp b_1 b_2)pq+(a_2^2\mp b_2^2)q^2. \end{align*}\begin{align*} ap^2+2bpq+cq^2 &= (a_1 p+a_2 q)^2\mp (b_1 p+ b_2 q)^2\\ &= (a_1^2\mp b_1^2)p^2+2(a_1 a_2 \mp b_1 b_2)pq+(a_2^2\mp b_2^2)q^2. \end{align*}

Moreover, since we have integers and each form is improperly equivalent to itself, it can be forced that
$$\begin{pmatrix}a_1&a_2\\ b_1& b_2\end{pmatrix}\in SL_2(\mathbb{Z})\implies\det\begin{pmatrix}a_1&a_2\\ b_1& b_2\end{pmatrix}=a_1 b_2 - a_2 b_1=1,\begin{pmatrix}a_1&a_2\\ b_1& b_2\end{pmatrix}\in SL_2(\mathbb{Z})\implies\det\begin{pmatrix}a_1&a_2\\ b_1& b_2\end{pmatrix}=a_1 b_2 - a_2 b_1=1,$$ One direction of the proposition follows from comparing coefficients. The other is straightforward by substituting and expanding.

So all solutions can be generated by $$SL_2(\mathbb{Z})SL_2(\mathbb{Z})$$.

Lemma 3. We have that $$a,b,c,d\in\mathbb{Z}a,b,c,d\in\mathbb{Z}$$ satisfy

1. $$a^2+b^2=c^2+d^2a^2+b^2=c^2+d^2$$ if and only if there exist $$p,q,r,s\in\mathbb{Z}p,q,r,s\in\mathbb{Z}$$ such that $$(a,b,c,d)=(pq+rs, pr-qs, pq-rs, pr+qs).(a,b,c,d)=(pq+rs, pr-qs, pq-rs, pr+qs).$$ This is assuming, without loss of generality, that $$a,ca,c$$ have the same parity and so do $$b,db,d$$.
2. $$a^2+b^2+c^2=d^2a^2+b^2+c^2=d^2$$ if and only if there exist $$p,q,r,s\in\mathbb{Z}p,q,r,s\in\mathbb{Z}$$ such that $$(a,b,c,d)=(ps+qr, p^2-q^2+r^2-s^2, pq-rs, p^2+q^2+r^2+s^2).(a,b,c,d)=(ps+qr, p^2-q^2+r^2-s^2, pq-rs, p^2+q^2+r^2+s^2).$$

Proof.

1. Suppose $$a,b,c,d\in\mathbb{Z}a,b,c,d\in\mathbb{Z}$$ satisfy $$a^2+b^2=c^2+d^2a^2+b^2=c^2+d^2$$. Assume, without loss of generality, that $$a,ca,c$$ have the same parity and so do $$b,db,d$$. Define the integers $$(2a_0, 2b_0, 2c_0, 2d_0)=(a+c, d+b, a-c, d-b).(2a_0, 2b_0, 2c_0, 2d_0)=(a+c, d+b, a-c, d-b).$$ so that the equation can be manipulated to $$a_0 c_0= b_0 d_0a_0 c_0= b_0 d_0$$.

Since $$\mathbb{Z}\mathbb{Z}$$ is a unique factorization domain, there exist $$p,q,r,s\in\mathbb{Z}p,q,r,s\in\mathbb{Z}$$ such that $$(a_0,b_0,c_0,d_0)=(pq,pr,rs,qs)(a_0,b_0,c_0,d_0)=(pq,pr,rs,qs)$$. Then $$(a,b,c,d)=(pq+rs,pr-qs,pq-rs,pr+qs).(a,b,c,d)=(pq+rs,pr-qs,pq-rs,pr+qs).$$

The converse holds by Fibonacci's identity $$(pq+rs)^2+(pr-qs)^2=(pq-rs)^2+(pr+qs)^2.(pq+rs)^2+(pr-qs)^2=(pq-rs)^2+(pr+qs)^2.$$

1. Suppose $$a,b,c,d\in\mathbb{Z}a,b,c,d\in\mathbb{Z}$$ satisfy $$a^2+b^2+c^2=d^2a^2+b^2+c^2=d^2$$. Rewrite the equation as $$(c+ai)(c-ai)=(d+b)(d-b)(c+ai)(c-ai)=(d+b)(d-b)$$ in Gaussian integers. Since $$\mathbb{Z}[i]\mathbb{Z}[i]$$ is a unique factorization domain, there exist $$x=p+rix=p+ri$$ and $$y=q+siy=q+si$$ in $$\mathbb{Z}[i]\mathbb{Z}[i]$$ such that $$(c+ai,c-ai, d+b, d-b)=(xy, \bar{x}\bar{y},x\bar{x}, y\bar{y}),(c+ai,c-ai, d+b, d-b)=(xy, \bar{x}\bar{y},x\bar{x}, y\bar{y}),$$ where the bar denotes complex conjugation. Then $$\begin{cases} c+ai=(pq-rs) +(ps+qr)i\\ d+b=p^2+r^2\\ d-b=q^2+s^2\end{cases}\begin{cases} c+ai=(pq-rs) +(ps+qr)i\\ d+b=p^2+r^2\\ d-b=q^2+s^2\end{cases}$$ so
$$(a,2b,c,2d)=(ps+qr, p^2-q^2+r^2-s^2, pq-rs, p^2+q^2+r^2+s^2).(a,2b,c,2d)=(ps+qr, p^2-q^2+r^2-s^2, pq-rs, p^2+q^2+r^2+s^2).$$

The converse holds by Lebesgue's identity $$(2(ps+qr))^2+(p^2-q^2+r^2-s^2)^2+(2(pq-rs))^2=(p^2+q^2+r^2+s^2)^2.(2(ps+qr))^2+(p^2-q^2+r^2-s^2)^2+(2(pq-rs))^2=(p^2+q^2+r^2+s^2)^2.$$