Which primes $p,q$ satisfy $p^{q-1}+q^{p-1}=m^2$ for some integer $m$?

222 Views Asked by At

In an Olympiad style collection of problems, I came across this:

Find all primes $p$ and $q$ such that $p^{q-1}+q^{p-1}=m^2$ for some integer $m$.

I first decided to find some primes of this form, one example being $p=q=2$. I couldn't find any other examples as I didn't have a calculator with me and the numbers got very large very quickly!

I then thought perhaps I can use some results I know relating to Pythagorean triples - $a^2+b^2=c^2$, if $a=m^2-n^2, b+2mn, c=m^2+n^2$. I didn't get anywhere though!

The only result I could come up with was "apart from $p=2$, the equation does not hold if $p=q$." We see this because if $p$ is prime, greater than $2$, then $p^{p-1}+p^{p-1} = 2p^{p-1}$, and $2$ divides this value exactly once, so it cannot be square.

Any help would be appreciated!

1

There are 1 best solutions below

0
On BEST ANSWER

If $p,q$ are odd primes then $p^{q-1} = 1 \mod 4 $ and $q^{p-1} = 1 \mod 4$ so $p^{q-1} +q^{p-1}= 1+1 \mod 4 = 2 \mod 4$ so $m^2 \not = 2 \mod 4$.

So one of the primes have to be $2$, let $q=2$ we have $2^{p-1} + p ^{2-1} = 2^{p-1} + p=m^2$

For $(2,2)$ there is an integer solution, so we are assuming that $p$ is odd prime.

We have that $p+2^{p-1} = m^2$ which is $p = m^2 -2^{p-1}$ which is $p = (m+2^{\frac{p-1}{2}}) ( m-2^{\frac{p-1}{2}})$, since $p$ is prime this means that $m+2^{\frac{p-1}{2}}= p $ and $m-2^{\frac{p-1}{2}}=1 $, adding both equations to get that $2m = p+1$ so $m=\frac{p+1}{2}$, which is obviously not true for all $p\geq 3$ since $p+2^{p-1} > (\frac{p+1}{2})^2$.

Thus concluding the only solution is $(2,2)$.