Ta có:
\(2n+7⋮n+2\)
\(\Rightarrow\left(2n+4\right)+3⋮n+2\)
\(\Rightarrow2\left(n+2\right)+3⋮n+2\)
\(\Rightarrow3⋮n+2\)
\(\Rightarrow n+2\in U\left(3\right)=\left\{-1;1;-3;3\right\}\)
\(\Rightarrow\left\{{}\begin{matrix}n+2=-1\Rightarrow n=-3\\n+2=1\Rightarrow n=-1\\n+2=-3\Rightarrow n=-5\\n+2=3\Rightarrow n=1\end{matrix}\right.\)
Vậy \(n\in\left\{-3;-1;-5;1\right\}\)