
2. Find all primes $p$ and $q$, and even numbers $n>2$, satisfying the equation

$$
p^{n}+p^{n-1}+\cdots+p+1=q^{2}+q+1
$$


Solution: Obviously $p \neq q$. We write this in the form

$$
p\left(p^{n-1}+p^{n-2}+\cdots+1\right)=q(q+1)
$$

If $q \leq p^{n / 2}-1$, then $q2$. It follows that $q \geq p^{n / 2}$. Since $n>2$ and is an even number, $n / 2$ is a natural number larger than 1 . This implies that $q \neq p^{n / 2}$ by the given condition that $q$ is a prime. We conclude that $q \geq p^{n / 2}+1$. We may also write the above relation in the form

$$
p\left(p^{n / 2}-1\right)\left(p^{n / 2}+1\right)=(p-1) q(q+1)
$$

This shows that $q$ divides $\left(p^{n / 2}-1\right)\left(p^{n / 2}+1\right)$. But $q \geq p^{n / 2}+1$ and $q$ is a prime. Hence the only possibility is $q=p^{n / 2}+1$. This gives

$$
p\left(p^{n / 2}-1\right)=(p-1)(q+1)=(p-1)\left(p^{n / 2}+2\right)
$$

Simplification leads to $3 p=p^{n / 2}+2$. This shows that $p$ divide 2. Thus $p=2$ and hence $q=5, n=4$. It is easy to verify that these indeed satisfy the given equation.
