18. Find all integers $n$ for which $n^{5}+3$ is divisible by $n^{2}+1$.
18. Consider the expression:

$$
\frac{n^{5}+3}{n^{2}+1}=\frac{\left(n^{5}-n\right)+(n+3)}{n^{2}+1}=n\left(n^{2}-1\right)+\frac{n+3}{n^{2}+1}
$$

It is clear that we need to find all such integers $n$ for which the expression $\frac{n+3}{n^{2}+1}$ is an integer. It is easy to verify that there are only 5 required values of $n$: $-3,-1,0,1,2$.