Determining all the positive integers $n$ such that $n^4+n^3+n^2+n+1$ is a perfect square. I successfully thought of bounding our expression examining consecutive squares that attain values close to it, and this led to the solution I'll post as an answer, which was the one reported. However, before that, I had briefly tried manipulating $$n^4+n^3+n^2+n+1=m^2.$$Since $n=1$ is not a solution, I rewrote this as $$\frac{n^5-1}{n-1}=m^2 \\ n^5-1=nm^2-m^2 \\ m^2-1=n(m^2-n^4) \\ (m-1)(m+1)=n(m-n^2)(m+n^2),$$ but in vain. Does manipulation lead somewhere? Is there a different approach from both of mine?
 A: For all positive $n$ we have $$\require\cancel \left(n^2+\frac{n}{2}\right)^2=\cancel{n^4+n^3}+\frac{n^2}{4}<\cancel{n^4+n^3}+n^2+n+1 \\ \frac{n^2}{4}<n^2+n+1 $$ and on the other hand $$\require\cancel \left(n^2+\frac{n+2}{2}\right)^2=n^4+n^3+2n^2+\frac{n^2+4n+4}{4}>n^4+n^3+n^2+n+1 \\ \cancel{n^4+n^3}+\frac{9}{4}n^2\cancel{+n+1}>\cancel{n^4+n^3}+n^2\cancel{+n+1} \\ \frac{9}{4}n^2>n^2.$$ As a consequence, $n$ cannot be even, and for some odd $n$ we must have $$\left(n^2+\frac{n+1}{2}\right)^2=\cancel{n^4+n^3+n^2}+\frac{n^2+2n+1}{4}=\cancel{n^4+n^3+n^2}+n+1 \\ n^2+2n+1=4n+4 \\ n^2-2n-3=(n-3)(n+1)=0,$$ whence $n=3$. In particular, $$3^4+3^3+3^2+3+1=11^2.$$
A: There are only two additional non-positives that also give perfect squares.

Case 1: $\boldsymbol{n}$ odd
$$
\begin{align}
\left(n^2+\frac{n-1}2\right)^2
&=n^4+n^2(n-1)+\frac{n^2-2n+1}4\\
&=n^4+n^3-\frac34n^2-\frac12n+\frac14
\end{align}
$$
smaller than $n^4+n^3+n^2+n+1$ if $\frac74n^2+\frac32n+\frac34\gt0$
$$
\begin{align}
\left(n^2+\frac{n+1}2\right)^2
&=n^4+n^2(n+1)+\frac{n^2+2n+1}4\\
&=n^4+n^3+\frac54n^2+\frac12n+\frac14
\end{align}
$$
bigger than $n^4+n^3+n^2+n+1$ if $\frac14n^2-\frac12n-\frac34\gt0$.
Only leaves $n=-1,1,3$. Only $-1,3$ give squares.

Case 2: $\boldsymbol{n}$ even
$$
\begin{align}
\left(n^2+\frac{n}2\right)^2
&=n^4+n^2n+\frac{n^2}4\\
&=n^4+n^3+\frac14n^2
\end{align}
$$
smaller than $n^4+n^3+n^2+n+1$ if $\frac34n^2+n+1\gt0$
$$
\begin{align}
\left(n^2+\frac{n+2}2\right)^2
&=n^4+n^2(n+2)+\frac{(n+2)^2}4\\
&=n^4+n^3+\frac94n^2+n+1
\end{align}
$$
bigger than $n^4+n^3+n^2+n+1$ if $\frac54n^2\gt0$.
Only leaves $n=0$, which gives a square.

Thus, only $n\in\{-1,0,3\}$ give squares.
A: Hint: notice that
$$ (2n^2+n)^2 = 4n^4+4n^3+n^2, $$
$$ (2n^2+n+1)^2 = 4n^4+4n^3+5n^2+2n+1 $$
are two consecutive squares and $4(n^4+n^3+n^2+n+1)$ is just between them, with very few exceptions. An old motto says "too close to a square to be a square, it is not a square".
