Ta có: \(n^2-2n-22⋮n+3\)
\(\Leftrightarrow n^2+3n-5n-15-7⋮n+3\)
\(\Leftrightarrow n\left(n+3\right)-5\left(n+3\right)-7⋮n+3\)
\(\Leftrightarrow\left(n+3\right)\left(n-5\right)-7⋮n+3\)
mà \(\left(n+3\right)\left(n-5\right)⋮n+3\)
nên \(-7⋮n+3\)
\(\Leftrightarrow n+3\inƯ\left(-7\right)\)
\(\Leftrightarrow n+3\in\left\{1;-1;7;-7\right\}\)
hay \(n\in\left\{-2;-4;4;-10\right\}\)
Vậy: \(n\in\left\{-2;-4;4;-10\right\}\)