1

Are there any prime solutions to $p^q - q^p = 3$? (For the prime numbers $p$ and $q$)

If so what are they?

This problem is meant to be solved with modular arithmetic.

I tried proving that firstly they must be of different parity (congruence $\bmod 2$) since two numbers must be of different parity to equal an odd difference. Therfore one of the prime numbers must be even as that is the only way to achieve an even number with a prime. This gives us $p^2 - 2^p = 3$ or $2^q - p^2 =3$.

Then we use $\bmod 6$

$2^p$ congruent $2 \bmod 6$ where $p$ is always an odd number since it is prime and not $2$ $2^p$ congruent $2 \bmod 3$ since $2^{\text{even}}$ congruent $1 \bmod 3$ and that gives possibillities of $1$ or $4 \bmod 6$ which both result in $2 \bmod 6$ when doubled.

Secondly $p^2 \bmod 6 = 1$ since $p^2 \bmod 3 = 1$ (Fermat's little theorem) or since all prime numbers greater than $3$ can be expressed as $6n \pm 1$.

Is there any fault in my logic or a way to write any prime solution to the problem?

Gary
  • 31,845
  • 2
    If both $p$ and $q$ are odd primes, then both $p^q$ and $q^p$ are odd, and their difference must be even (cannot be $3$). If $p=q=2$, then $p^q-q^p=2^2-2^2=0$ (which is not $3$). The only remaining possible case is that $p=2$ and $q$ is an odd prime, then $2^q-q^2$ must be odd. Checking the possibilities: $2^3-3^2=-1$, next $2^5-5^2=7$ which exceeds the requirement (the $3$). And as you go further, the difference will also grow, because exponential functions grow faster than polynomial functions. Hence impossible. – Hussain-Alqatari Mar 05 '24 at 10:16
  • 2
    This is also solvable without assuming $p,q$ are primes, see for example Find integral solution of $a^{b} - b^{a} = 3$ – Sil Mar 05 '24 at 16:53
  • Suggested solutions from my teacher summarized. The powers p^q and q^p have different parity, so one of the prime numbers is even, that is, 2. And the other is then >=3. Solution one is for q is greater than or equal to 5 then the equation 2^q - q^2 > 3 and q=3 does not work. Better one is mod 3(same idea as me ) 2^q is kongruent -1 for all odd q and p^2 is kongruent to 0 or 1 and 3 is kongruent 0. Modulo 8 also works as 2^q is kongruent to 0 as q is equal to or grater than 3 and q^2 is kongruent to 0 or 1, and 3 is 3. – Spinarak167 Mar 11 '24 at 08:00

0 Answers0