Under which conditions the rings $\mathbb{Z}_p[x]/(x^n+1)$ and $\mathbb{Z}_p[x]/(x^n-1)$ are fields? (for $p$ prime) I'm looking for the necessary and sufficient conditions for any prime $p$ and any positive integer $n$ to make the quotient rings $\mathbb{Z}_p[x]/(x^n+1)$ and $\mathbb{Z}_p[x]/(x^n-1)$ not only rings but fields.
I know that the quotient ring $\mathbb{Z}_p[x]/f(x)$ is a field if and only if $f(x)$ is irreducible over $\mathbb{Z}_p$:


*

*Then $\mathbb{Z}_p[x]/(x^n-1)$ can never be a field, as $1$ is a root of $x^n-1$ in $\mathbb{Z}_p[x]$, making it reducible, am I right?

*For $\mathbb{Z}_p[x]/(x^n+1)$:
2.1. If $n\geq p$, then $f(x)=x^n+1$ might have a root in $\mathbb{Z}_p$, as one of the two following cases happens: either (a) all integers in $\mathbb{Z}_p^*$ are roots of $f(x)$, or (b) there is a monic polynomial $g(x)$ such that $g(x)\equiv 0 (\text{mod }p)$ with $\text{deg}(g)<p$ and the solutions of $g(x)\equiv 0(\text{mod }p)$ are the solutions of $f(x)\equiv 0 (\text{mod }p)$. 
Note: In (b), if the equation $g(x)\equiv 0(\text{mod }p)$ has no solutions, then $f(x)\equiv 0(\text{mod }p)$ has no solutions as well.
2.2. If $n<p$, then for all integers $a$ with $\gcd(a,p)=1$, we have that $x^n\equiv a(\text{mod }p)$ has exactly $\gcd(n,p-1)$ solutions if $$a^{\frac{p-1}{\gcd(n,p-1)}}\equiv 1(\text{mod }p),$$ or no solution at all if $$a^{\frac{p-1}{\gcd(n,p-1)}}\not\equiv 1(\text{mod }p).$$ Then by taking $a=p-1$, we have that $x^n+1\equiv 0(\text{mod }p)$ which is equivalent to $x^n\equiv p-1(\text{mod }p)$ has exactly $\gcd(n,p-1)$ solutions if $$(-1)^{\frac{p-1}{\gcd(n,p-1)}}\equiv 1(\text{mod }p),$$ or no solutions at all if $$(-1)^{\frac{p-1}{\gcd(n,p-1)}}\not\equiv 1(\text{mod }p).$$
My questions are:


*

*Just to be sure, $\mathbb{Z}_p[x]/(x^n-1)$ is never a field, right?

*Is there any easier criteria or direct theorem I'm missing for the case $\mathbb{Z}_p[x]/(x^n+1)$ which could give me a more straight-forward condition for $p$ and $n$?


Thank you.
 A: $1$ is a root of $x^n-1$ thus it is irreducible iff $n=1$.
$x^n+1$ is irreducible iff $f=[\Bbb{F}_p(\zeta_{2n}):\Bbb{F}_p]=n$ iff the least integer such that $2n | p^m-1$ is $m=n$.
ie. $f=order(p\bmod 2n) $. It divides $\varphi(2n)$.
$n| \varphi(2n)$ implies $n=2^k$.
And $order(p\bmod 2^{k+1})=2^k$ implies that $k=0$ or $1$
and hence either $n=1$ or $n=2$ and $p\equiv 3\bmod 4$.
A: First consider $x^n-1$ . . .

If $n=1$ then $x^n-1=x-1$ which is irreducible in $\mathbb{Z}_p[x]$.

If $n > 1$ then $x^n-1$ has the factor $x-1$, so $x^n-1$ is reducible in $\mathbb{Z}_p[x]$.

Next consider $x^n+1$ . . .

If $n=1$ then $x^n+1=x+1$ which is irreducible in $\mathbb{Z}_p[x]$.

If $n$ is odd and $n > 1$, then $x^n+1$ has the factor $x+1$, so $x^n+1$ is reducible in $\mathbb{Z}_p[x]$.

If $n$ is an even positive integer but not a power of $2$, then $n$ has an odd prime factor, $q$ say, with $q < n$. Letting $m=n/q$, it follows that $x^n+1$ has the factor $x^m+1$, so $x^n+1$ is reducible in $\mathbb{Z}_p[x]$.

If $n=2$ then $x^n+1=x^2+1$ which factors mod $p$ if and only if $-1$ is a quadratic residue mod $p$, which happens if and only if $p=2$ or $p\equiv 1\;(\text{mod}\;4)$.

If $n=4$ then $x^n+1=x^4+1$ which is reducible mod $p$ for all primes $p$.

$\qquad$Why is $X^4+1$ reducible over $\mathbb F_p$ with $p \geq 3,$ prime

If $n$ is a power of $2$ with $n > 4$, then since $x^4+1$ is reducible mod $p$ for all primes $p$, it follows that $x^n+1$ is reducible mod $p$ for all primes $p$.
