\(n+5⋮n+2\)
=> \(\left(n+2\right)+3⋮n+2\)
=> \(3⋮n+2\)
=> \(n+2\inƯ\left(3\right)=\left\{\pm1;\pm3\right\}\)
=> \(\left\{{}\begin{matrix}\left[{}\begin{matrix}n+2=1\\n+2=-1\end{matrix}\right.\\\left[{}\begin{matrix}n+2=3\\n+2=-3\end{matrix}\right.\end{matrix}\right.\)
=> \(\left\{{}\begin{matrix}\left[{}\begin{matrix}n=1-2=-1\\n=-1-2=-3\end{matrix}\right.\\\left[{}\begin{matrix}n=3-2=1\\n=-3-2=-5\end{matrix}\right.\end{matrix}\right.\)
Vậy \(n\in\left\{-1;-3;1;-5\right\}\)