Find the integers $n$ such that $n-1$ divides $n^{2}+2$.
If $n-1$ divides $n^{2}+2$, then $n-1$ divides $\left(n^{2}+2\right)-(n+1) \times(n-1)=3$, so $n-1 \in\{-3,-1,1,3\}$ and $n \in\{-2,0,2,4\}$. Conversely,

- if $n=-2$, then $n-1=-3$ divides $n^{2}+2=6$;
- if $n=0$, then $n-1=-1$ divides $n^{2}+2=2$;
- if $n=2$, then $n-1=1$ divides $n^{2}+2=6$;
- if $n=4$, then $n-1=3$ divides $n^{2}+2=18$.

Therefore, $n-1$ divides $n^{2}+2$ if and only if $n \in\{-2,0,2,4\}$.