<s>[INST] $p^{q+1}+ q^{p+1}$ is a perfect square. Find all the prime numbers $p$ and $q$ such that $p^{q+1} + q^{p+1}$ is a perfect square.  I tried this but I can't imagine where should I start fromCan some one give me a hint please.
 [/INST] If $p,q$ are odd primes $\implies p,q \equiv ± 1\ mod\ 4$
$$p^{q+1} + q^{p+1} \equiv (±1)^{q+1}+(±1)^{p+1} \ mod\ 4 \equiv 2\ mod\ 4$$
And we know perfect squares are $\equiv 0,1 \ mod\ 4 \implies p\ or\ q$ must be even.
Let's take $p= 2$
$$2^{q+1} + q^{3} \equiv q \ mod\ 4 \implies q \equiv 1\ mod\ 4$$
Now,
$$2^{\cfrac{2(q+1)}{2}} + q^3 = k^2$$
Notice that $k$ is odd
$$k^2 - 2^{q+1} = q^3$$
$$\left(k+2^{\cfrac{q+1}2}\right)\left(k-2^{\cfrac{q+1}2}\right) = q^3$$
Case 1:
$$\left(k+2^{\cfrac{q+1}2}\right) = q^2 \ and\ \left(k-2^{\cfrac{q+1}2}\right) =q$$
Adding both,
$$2k = q+q^2 \implies k = \cfrac{q+q^2}{2}$$
$$2^{q+1} + q^3 = {\left(\cfrac{q+q^2}{2}\right)}^2 = \cfrac{q^2+q^4}{4} + q^3 \implies 2^{p+3} = q^2(1 + q^2)$$ a contradiction
Case 2:
$$\left(k+2^{\cfrac{q+1}2}\right) = q^3 \ and\ \left(k-2^{\cfrac{q+1}2}\right) =1$$
Using $k = 1 + 2^{\cfrac{q+1}2} \implies k^2 = 1 + 2^{q+1} + 2^{\cfrac{q+1}2 + 1}$
Putting $k^2$ in equation,
$$2^{q+1} + q^3 = 1 + 2^{q+1} + 2^{\cfrac{q+1}2 + 1} \implies q^3 - 1 = 2^{\cfrac{q+1}2 + 1}= (q-1)(q^2 + q + 1)$$
Again not possible
We are left with only option, $p,q$ must be even and only even prime is $2$
$$2^3 + 2^3 = 16 = 4^2$$
Only solution is $(p,q) = (2,2)$
</s>