Find all positive integers $n > 1$ such that the polynomial $P(x)$ belongs to the ideal generated by the polynomial $x^2 +x +1$ in $\Bbb Z_n[x]$ 
Find all positive integers $n > 1$ such that the polynomial $x^4 + 3x^3 + x^2 + 6x + 10$ belong to the ideal generated by the polynomial $x^2 + x + 1$ in $\Bbb Z_n[x]$.

My attempt: I was using the Division Algorithm 
$$P(X)= X^4 + 3x^3 + X^2 +6X + 10 = (X^2 + x + 1)( x^2 + 2x -2) + (6x + 12).$$
Here I got the remainder $6x + 12$ not equal to $0$, so $P(x)$ is irreducible over $\Bbb Z_n[x]$ because it cannot be factored into the product of two non-constant polynomials.
My thinking is that $\Bbb Z_3[x]$ is only the satisfied  $x^2 + x + 1$ 
$$(1)^2 + 1 + 1 =3$$ and we if we divide $3/3 =1$ and remainder $= 0$.
Therefore $3$ is the only positive integer $n > 1$ such that the polynomial $P(x)$ belong to the ideal generated by the polynomial $x^2 + x + 1$ in $\Bbb Z_n[x]$.

Is my answer is correct or not? I would be more thankful to rectifying my mistake.


Because $x^4+3x^3+x^2+6x+10$ is in the ideal, 
$p(x)=x^4+3x^3+x^2+6x+10-(x^2 + x + 1)( x^2 + 2x -2)=6x+12 $ is also in the ideal. 
So $6x+12=q(x)*(x^2+x+1)=q(x)x^2+(x+1)q(x)$.
As $deg(6x+12)=1$, $q(x)x^2=0$. Also $deg q(x)=1$, which leads to $6x+12=0$.
Therefore, n=2,3 or 6.
