<s>[INST] Find all $p$'s such that $p^4 + p^3 + p^2 + p +1$ is a perfect square. 
Let $p$ be a prime number. Find all $p$'s such that $p^4 + p^3 + p^2 + p +1$ is a perfect square.

I tried rewriting the expression as  $p^4 + p^3 + p^2 + p +1 = x^2 \iff (p^2 + p)(p^2 + 1)=(x - 1)(x + 1)$. Then I think I need to bound this using $x$ but am not sure how to.
 [/INST] Note that $p^2=q^4+q^3+q^2+q+1$ has solutions only for $p=11$ and $q=3$.
Indeed we can write $$\left(q^2+\frac{q}{2}\right)^2={q^4+q^3}+\frac{q^2}{4}<{q^4+q^3}+q^2+q+1 \\ \frac{q^2}{4}<q^2+q+1 $$ and on the other hand $$ \left(q^2+\frac{q+2}{2}\right)^2=q^4+q^3+2q^2+\frac{q^2+4q+4}{4}>q^4+q^3+q^2+q+1 \\ {q^4+q^3}+\frac{9}{4}q^2{+q+1}>{q^4+q^3}+q^2{+q+1} \\ \frac{9}{4}q^2>q^2.$$ From here, $q$ cannot be even, and for some odd $q$ we must have $$\left(q^2+\frac{q+1}{2}\right)^2={q^4+q^3+q^2}+\frac{q^2+2q+1}{4}={q^4+q^3+q^2}+q+1 \\ q^2+2q+1=4q+4 \\ q^2-2q-3=(q-3)(q+1)=0,$$ from here $q=3$. In particular, $$3^4+3^3+3^2+3+1=11^2$$
therefore the only solutions are $p=11$, $q=3$
</s>