Ta có:
\(A=\dfrac{n+2}{n-5}=\dfrac{\left(n-5\right)+7}{n-5}=\dfrac{n-5}{n-5}+\dfrac{7}{n-5}=1+\dfrac{7}{n-5}\)
Để \(A\in Z\) thì \(\dfrac{7}{n-5}\in Z\Rightarrow7⋮n-5\) hay \(n-5\in U\left(7\right)=\left\{\pm1;\pm7\right\}\)
Ta có bảng sau:
\(n-5\) | \(1\) | \(-1\) | \(7\) | \(-7\) |
\(n\) | \(6\) | \(4\) | \(12\) | \(-2\) |
Vậy, với \(n\in\left\{-2;4;6;12\right\}\) thì \(A=\dfrac{n+2}{n-5}\in Z\).
\(A\in Z\Rightarrow n+2⋮n-5\)
\(\Rightarrow\left(n-5\right)+7⋮n-5\)
\(\Rightarrow7⋮n-5\)
\(\Rightarrow n-5\in\left\{1;-1;7;-7\right\}\)
\(\Rightarrow n\in\left\{6;4;12;-2\right\}\)
Vậy \(n\in\left\{6;4;12;-2\right\}\)
Để \(n\in Z\)thì
\(n+2⋮n-5\)
\(n-5+7⋮n-5\)
Vì:
\(n-5⋮n-5\)
nên
\(7⋮n-5\)
\(\Rightarrow n-5\inƯ\left(7\right)\)
\(Ư\left(7\right)=\left\{\pm1;\pm7\right\}\)
\(n=\left\{6;4;-2;12\right\}\)