Để A nguyên thì n-2\(⋮\)n+1.
Ta có:n-2=n+1-1-2=(n+1)-3
Vì (n+1)\(⋮\)(n+1)\(\Rightarrow\)3\(⋮\)n+1\(\Rightarrow\)n+1\(\in\) Ư(3)={\(\pm\)1,\(\pm\)3}
\(\Leftrightarrow\left[{}\begin{matrix}n+1=1\\n+1=-1\\n+1=3\\n+1=-3\end{matrix}\right.\)
\(\Leftrightarrow\left[{}\begin{matrix}n=1-1\\n=-1-1\\n=3-1\\n=-3-1\end{matrix}\right.\)
\(\Leftrightarrow\left[{}\begin{matrix}n=0\\n=-2\\n=2\\n=-4\end{matrix}\right.\)
\(A=\frac{n-2}{n+1}=\frac{n+1-3}{n+1}=1-\frac{3}{n+1}\)(1)
từ 1 ta thấy để A thuộc Z thì \(\frac{3}{n+1}\in Z\)
\(\Rightarrow\)3 chia hết cho n+1
\(\Rightarrow\)n+1 thuộc Ư(6)
\(\Rightarrow\)n+1 thuộc {-3;-1;1;3}
\(\Rightarrow\)n thuộc {-4;-2;0;2}