Find all triples of prime numbers $(p,q,r)$ such that $$p^q+q^r=r^p.$$
I proved that when $r=2$, the equation becomes $$p^q+q^2=2^p.$$ Then I tried to use reciprocity laws and Fermat's little theorem. I could prove that $p\equiv 7\pmod 8$ and that $p>q$.
The equation appeared in some olympiad . They asked to prove that $r=2$. So I am trying to find at least one triple.
It is clear that precisely one of $p$, $q$ and $r$ must equal $2$. We'll first show that in fact $r=2$:
Observation 1: $r=2$.
If $q=2$ then reducing mod $3$ shows that $$p^2+2\equiv r^p\pmod{3},$$ so either $p=3$ or $r=3$. Both are easily verified to be impossible.
If $p=2$ then $$2^q+q^r=r^2,$$ but for all primes $q,r>2$ we have $q^r>r^2$, a contradiction.
This leaves us with finding odd primes $p$ andd $q$ satisfying $$p^q+q^2=2^p.$$ We first make a few more simple observations.
Observation 2: $q^2\equiv2\pmod{p}$.
By Fermat's little theorem $$q^2\equiv p^q+q^2\equiv2^p\equiv2\pmod{p}.$$
Observation 3: $q<p$.
As $p>2$ we have $2^q<p^q+q^2=2^p$, so $q<p$.
The problem can be rephrased in the number ring $\Bbb{Z}[\sqrt{2}]$. This is a unique factorization domain with unit group $\{\pm1\}$. Setting $m:=\frac{p-1}{2}$ we can rewrite the equation above as $$p^q=-(q+2^m\sqrt{2})(q-2^m\sqrt{2}).$$ The greatest common divisor of the two factors on the right hand side divides both $2q$ and $p^q$. Because $p$ and $q$ are distinct, these two factors are coprime and so both are $q$-th powers in $\Bbb{Z}[\sqrt{2}]$. Let $a,b\in\Bbb{Z}$ be such that $$q+2^m\sqrt{2}=(a+b\sqrt{2})^q.$$ Then $q-2^m\sqrt{2}=(a-b\sqrt{2})^q$ and hence $$p^q=-(a+b\sqrt{2})^q(a-b\sqrt{2})^q=(2b^2-a^2)^q,$$ which shows that $p=2b^2-a^2$.
Observation 4: $a=\pm q$ and $b\mid2^m$. (Thanks to barto's comment)
Set $\alpha:=a+b\sqrt{2}$ and $\bar{\alpha}:=a-b\sqrt{2}$. Because $$(\alpha+\bar{\alpha})\mid(\alpha^2+\bar{\alpha}^q)\qquad\text{ and } \qquad(\alpha-\bar{\alpha})\mid(\alpha^2-\bar{\alpha}^q),$$ we see that $2a\mid2q$ and $2b\sqrt{2}\mid2^{m+1}\sqrt{2}$. The binomial expansion $$q+2^m\sqrt{2}=(a+b\sqrt{2})^q,$$ shows that $q\mid a^q$, and hence that $q\mid a$ so $a=\pm q$.
Observation 5: $b=\pm1$.
By observation 3 we have $a^2=q^2<p^2$, and so $$p=2b^2-a^2>2b^2-p^2.$$ Because $p>q>2$ we have $p\geq5$ and so $b^2<\frac{p^2+p}{2}\leq(p-1)^2$. Also, by observation 2 $$p=2b^2-a^2=2b^2-q^2\equiv2b^2-2\pmod{p},$$ and so $b^2\equiv1\pmod{p}$. This means $b=\pm1$.
We have $a=\pm q$ and $b=\pm1$ and so $$p=2b^2-a^2=2-q^2<0,$$ a contradiction.