5. There are a few integers $n$ such that $n^{2}+n+1$ divides $n^{2013}+61$. Find the sum of the squares of these integers.
5. Answer: 62
Solution. Since $n^{3}-1=(n-1)\left(n^{2}+n+1\right)$, we know that $n^{2}+n+1$ divides $n^{3}-1$. Also, since $n^{2013}-1=\left(n^{3}\right)^{671}-1$, we also know that $n^{2}+n+1$ divides $n^{2013}-1$. As
$$
n^{2013}+61=n^{2013}-1+62,
$$
we must have that $n^{2}+n+1$ divides $n^{2013}+61$ if and only if $n^{2}+n+1$ divides 62 .
Case (i): If $n^{2}+n+1=1$, then $n=0,-1$.
Case (ii): If $n^{2}+n+1=2$, there is no integer solution for $n$.
Case (iii): If $n^{2}+n+1=31$, then $n=6,-5$.
Case (iv): If $n^{2}+n+1=62$, there is no integer solution for $n$.
Thus, all the integer values of $n$ are $0,-1,6,-5$. Hence the sum of squares is $1+36+25=$ 62.