Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $n$ satisfy the equation, $a^n+b^n=c^2$. When $a,b,c$ are prime numbers except $n$, there is one solution at least for the equation.

How to find the biggest possible value of $n$?

share|cite|improve this question
If n is even and b>a>2, $a^n≡b^n≡1(mod\ 8)≡1(mod 4)=>a^n+b^n≡2(mod\ 4)$, but $c^2≡0,1(mod\ 4)$, then one of a,b must be 2. – lab bhattacharjee Jul 11 '12 at 10:09
up vote 3 down vote accepted

It occurs to me that with all the conditions on the variables there is an elementary solution to this problem, and my earlier solution quoting Darmon and Merel is overkill.

First, if $a,b,c$ are all to be prime numbers, then it must be the case that all three are even, or that exactly one of them is even. In the first case, we have $$2^n+2^n=2^2$$ and the sole solution is $n=1$. So now we may suppose exactly one of $a,b,c$ is even. If $c$ is even, we have $$a^n+b^n=4$$ and the only solution is $1^1+3^1=4$, so again $n=1$. So now we may assume $a$ is even, and we have $$2^n+p^n=q^2\tag0$$ where $p,q$ are odd primes, and $n$ is not prime. If $n$ is odd then we have $$(2+p)(2^{n-1}-2^{n-2}p+\cdots+p^{n-1})=q^2\tag1$$ Since $q$ is prime, the only factorizations of $q^2$ are as $1\times q^2$ and $q\times q$. But for $n\gt1$, the second term on the left in (1) is greater than the first term, which is greater than 1, so (1) is impossible. Thus, in this case also $n=1$, and there are solutions such as $$2+7=3^2,\quad2+23=5^2,\quad2+47=7^2$$ and so on. Finally, we suppose $n=2k$ is even in (0). Then $$2^{2k}=q^2-(p^k)^2=(q+p^k)(q-p^k)$$ So $q+p^k$ and $q-p^k$ must both be even and must both be powers of 2, but their sum, $2q$, is not a multiple of 4, so we must have $$q+p^k=2^{2k-1},\quad q-p^k=2$$ This implies $$p^k=2^{2k-2}-1=(2^{k-1}+1)(2^{k-1}-1)$$ So $2^{k-1}+1$ and $2^{k-1}-1$ are both powers of $p$, but their difference, 2, is not a multiple of $p$, so $$p^k=2^{k-1}+1,\quad1=2^{k-1}-1$$ The second equation gives $k=2$, then the first gives $p^2=3$, contradiction.

So, we have an utterly elementary proof that $n=1$.

share|cite|improve this answer

Henri Darmon and Loic Merel, Winding quotients and some variants of Fermat's last theorem, J. Reine Angew. Math. 490 (1997), 81–100, MR1468926 (98h:11076) settled the problem. According to the review by Ken Kramer, they show that when $n\ge4$ the equation $x^n+y^n=z^2$ has no solution in integers with $|xyz|\gt1$ and $\gcd(x,y,z)=1$.

What follows is my earlier answer, which may now be ignored --- I leave it up solely because there were some comments on it.

The biggest $n$ is probably 3.

There are solutions (in coprime integers, here and below) to $a^3+b^3=c^2$.

There are no solutions to $a^4+b^4=c^2$.

There are no known solutions to $a^n+b^n=c^2$, for any $n\gt3$. I am not sure whether it has been proved that no solutions exist.

share|cite|improve this answer
I don't think this is true. IIRC, if n and m are relatively prime positive integers, there are solutions to $a^n + b^n = c^m$. The details (which I feel too tired to recreate now) depend on there being positive integers p and q such that $p n -q m = 1$. – marty cohen Jul 11 '12 at 4:58
@marty, you may be thinking of the case where $a,b,c$ are not required to be coprime. Fewer than a dozen examples of $a^r+b^s=c^t$ are known with $a,b,c$ coprime and $(1/r)+(1/s)+(1/t)\lt1$. – Gerry Myerson Jul 11 '12 at 5:48
But 3 is prime . – Frank Jul 11 '12 at 13:33
Oops - Gerry is absolutely right. I hope that's the biggest mistake I make this week - but it probably won't be. – marty cohen Jul 11 '12 at 22:42
- Fermat's last theorem doesn't restrict a, b, c to primes - Fermat's last theorem doesn't restrict n to non-primes - Fermat's last theorem has three integers to the n, not two and one simply squared. – Frank Jul 12 '12 at 0:30

I'm not sure I completely understand the "a,b,c, are prime numbers on one solution at least", but $\,2^n+2^n=2\cdot 2^n=2^{n+1}\,\Longrightarrow \,$ for any odd natural $\,n\,$: $$\,2^n+2^n=2^{n+1}=\left(c^{\frac{n+1}{2}}\right)^2\,\,,\,with\,\,\, c:=2^{\frac{n+1}{2}}$$

For example, $\,2^7+2^7=2^8=(2^4)^2$

Thus, there is no greatest value of n.

share|cite|improve this answer
Sorry ,i edit the question to be more clear . – Frank Jul 11 '12 at 3:05
I can't see how your re-edited question isn't addressed by my answer to your original post. What I wrote there still applies, as far as I can see... – DonAntonio Jul 11 '12 at 3:22
I suspect OP wants $a,b,c$ relatively prime. – Gerry Myerson Jul 11 '12 at 4:18
Oh, I'm almost sure, from the beginning, that is that what he wants...but let us wait until he finally writes that – DonAntonio Jul 11 '12 at 10:39
But Gerry Myerson answered that the biggest value of n is $3$ but this is a prime number. – Frank Jul 11 '12 at 10:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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