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 from
Can some one give me a hint please.
2026-03-26 07:58:22.1774511902
On
$p^{q+1}+ q^{p+1}$ is a perfect square.
708 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
1
On
Lemma: $a^2\equiv 0\text{ or }1 \mod 4$ for all $a\in\Bbb{Z}$.
In fact,
- if $a$ is even, then $a^2=(2k)^2=4k^2\equiv 0 \mod 4$
- if $a$ is odd, then $a^2=(2k+1)^2=4k^2+4k+1\equiv 1 \mod 4$.
Case 1: $p,q$ both odds.
Then $p+1$ and $q+1$ are even and $p^{q+1}\equiv q^{p+1}\equiv 1\mod 4$. Their sum can not be a square because is $2 \mod 4$.
Case 2: $p=q=2$.
Then $2^3+2^3=16=4^2$ is a square. Thus, $(p,q)=(2,2)$ is solution.
Case 3: wlog $p=2$ and $q$ is odd.
We have $2^{q+1}+q^3=t^2$. Because $q+1$ is even, $q^3=t^2-2^{q+1}=\underset{A}{(t-2^{(q+1)/2})}\underset{B}{(t+2^{(q+1)/2})}$
Now, we have 2 subcases:
a) $q^3=B$ and $1=A$.
b) $q^2=B$ and $q=A$.
Can you finish?
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)$