B1:
\(n^2+2n-7⋮n+2\)
\(\Leftrightarrow n\left(n+2\right)-7⋮n+2\)
Vì \(n\left(n+2\right)⋮n+2\Rightarrow-7⋮n+2\)
\(\Rightarrow n+2\inƯ\left(-7\right)=\left\{-1;1;-7;7\right\}\)
Ta có bảng sau:
\(n+2\) | \(-1\) | \(1\) | \(-7\) | \(7\) |
\(n\) | \(-3\) | \(-1\) | \(-9\) | \(5\) |
Vậy để \(n^2+2n-7⋮n+2\) thì \(n\in\left\{-9;-3;-1;5\right\}\)