Find all prime numbers satisfying an equation

226 Views Asked by At

Find all prime numbers $p,q $ and $r$, such that $p^q+q^p=r$

1

There are 1 best solutions below

0
On

Both @PeterForeman and @Peter have provided excellent comments that together pretty much point you to the answer of the problem. To flesh out their comments a little bit (rather than just tell you the answer), let's look closer at $p^q + q^p = r$

First, recall that for $k,n \in \Bbb{Z}^+, (2k+1)^n \equiv 1 \pmod 2$, meaning that any odd number raised to a positive integer power will be odd. In particular, all prime numbers $p \gt 2$ will be congruent to $1$ modulo $2$. Hence for all odd primes $p,q$, $$p^q + q^p \equiv 0 \pmod 2$$

In other words, if $p$ and $q$ are both odd primes, then $r$ cannot be a prime.

Similarly, $p$ and $q$ both cannot be the even prime $2$ as this results in $2^2 + 2^2 = 8$.

Our last case to check is if either one of $p$ or $q$ is $2$ and the other is an odd prime. To solve this case, we look at this equation modulo $3$.

For simplicity, let $p = 2$ as in @Peter's comment. This results in our equation now looking like this: $$2^q + q^2 = r$$

Starting with the first term, we have $2^q \equiv 2 \pmod 3$ if $q$ is an odd prime. To see this, note that $2^{2k+1} = 4^k(2) \equiv 1^k(2) \equiv 2 \pmod 3$

Next, we must look at $q^2$. Now $q$ must be either equivalent to $0,1, $ or $2$ modulo $3$. However, in the situations of $q \equiv 1$ or $q \equiv 2$ we arrive at $q^2 \equiv 1 \pmod 3$ and that leaves us with $2^q + q^2$ being divisible by $3$.

The final answer lies not much further ahead, you just need to look at the last case where $q$ is prime and $q \equiv 0 \pmod 3$. Going by the previous sentence, what does that mean for $q$?