1. ## Olympiad Problem- I am stuck

Find all primes p,q and even n>2 such that $p^n + p^{n - 1} + ... + 1 = q^2 + q + 1$.

My idea:

$p(p^{n - 1} + ..... + 1) = q(q + 1)$.

Let k be the largest power of p dividing q+1, then
$p^{n - 1} + ..... + 1 = qcp^{k - 1}$
If k>1 then the RHS is divisible by p and LHS is not(I am using n>2)
so $q+1 = pc$ for some $c \in \mathbb{N}$

It looks like I have deduced something, but then what do we do??
Or is this approach useless??

2. There is only one solution: $2^4+2^3+2^2+2+1 = 5^2+5+1$.

Here's a somewhat messy proof (I'm sure that a number theorist could come up with a better one).

I'll write 2n in place of n, just to keep track of the fact that n is even. So p and q are primes, and $1+q+q^2 = 1+p+p^2+\ldots+p^{2n} = \frac{p^{2n+1}-1}{p-1}$.

Therefore $p^{2n+1}-1 = (1+q+q^2)(p-1)$,

$p^{2n+1}-p = (q+q^2)(p-1)$,

$p(p^n+1)(p^n-1) = (p-1)q(q+1)$.

Thus q divides $p^n\pm1$, say $p^n+\epsilon = kq$, where $\epsilon=\pm1$ and $k\geqslant1$. Then $p(p^n+1)(p^n-1) = p(kq)(kq-2\epsilon)$ and so $kp(kq-2\epsilon) = (p-1)(q+1)$.

But kp > p–1 and therefore $kq-2\epsilon, so that $(k-1)q < 1+2\epsilon\leqslant3$. This is only possible if k=1. Therefore $q=p^n\pm1$.

If $q=p^n+1$ then $p(p^n-1) = (p-1)(q+1)$, so $p(q-2) = (p-1)(q+1)$ and therefore $q=3p-1$. If p is odd then this means that q is even, which is not possible since q is clearly greater than p. Therefore p=2 and q=5.

If $q=p^n-1$ then a similar calculation to the previous paragraph gives $p=-q-1$ which is obviously impossible.

So the only solution is p=2, q=5.