a: \(n^3-2⋮n-2\)
=>\(n^3-8+6⋮n-2\)
=>\(6⋮n-2\)
=>\(n-2\in\left\{1;-1;2;-2;3;-3;6;-6\right\}\)
=>\(n\in\left\{3;1;4;0;5;-1;8;-4\right\}\)
b: \(n^3-3n^2-3n-1⋮n^2+n+1\)
=>\(n^3+n^2+n-4n^2-4n-4+3⋮n^2+n+1\)
=>\(3⋮n^2+n+1\)
=>\(n^2+n+1\in\left\{1;-1;3;-3\right\}\)
mà \(n^2+n+1=\left(n+\dfrac{1}{2}\right)^2+\dfrac{3}{4}>=\dfrac{3}{4}\forall n\)
nên \(n^2+n+1\in\left\{1;3\right\}\)
=>\(\left[{}\begin{matrix}n^2+n+1=1\\n^2+n+1=3\end{matrix}\right.\Leftrightarrow\left[{}\begin{matrix}n^2+n=0\\n^2+n-2=0\end{matrix}\right.\)
=>\(\left[{}\begin{matrix}n\left(n+1\right)=0\\\left(n+2\right)\left(n-1\right)=0\end{matrix}\right.\Leftrightarrow n\in\left\{0;-1;-2;1\right\}\)