Ta có:
\(A=n^3-6n^2+9n-2\)
\(A=n^3-2n^2-4n^2+8n+n-2\)
\(A=n^2\left(n-2\right)-4n\left(n-2\right)+\left(n-2\right)\)
\(A=\left(n-2\right)\left(n^2-4n+1\right)\)
Để A là số nguyên tố
\(\Rightarrow\left[{}\begin{matrix}n-2=1\\n^2-4n+1=1\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}n=3\\n^2-4n=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}n=3\\n\left(n-4\right)=0\end{matrix}\right.\)
\(\Rightarrow\left[{}\begin{matrix}n=3\\n=0\\n=4\end{matrix}\right.\)