# About Ring of Gaussian integers modulo $n$

I am studying ring of Gaussian integers modulo $$n$$ i.e. $$\mathbb Z_n[i] = \{ a+ bi \mid a, b \in \mathbb Z_n\}$$ I saw that, it is field(hence Integral domain) whenever $$n$$ is prime number $$p$$ such that, $$p ≡3 \pmod 4$$. Now, is same true when it is integral domain? I means the ring of Gaussian integers modulo $$n$$ is an integral domain if and only if $$n$$ is prime $$p$$ such that, $$p≡3\pmod4$$?

• Note that $\mathbb{Z}[i]/n\mathbb{Z}[i]$ is finite. So it is an integral domain if and only if it is a field. – D_S Feb 25 '17 at 3:52

Yes, if $n$ is a rational integer, then $\mathbb{Z}[i]/n\mathbb{Z}[i]$ is a field if and only if it is an integral domain, if and only if $n$ is a prime number which is $\equiv 3 \pmod{4}$. You can argue this using some elementary number theory and some results about unique factorization domains (as well as the fact that $\mathbb{Z}[i]$ is a unique factorization domain). I'll show that if $n$ is not a prime number which is $3 \pmod{4}$, then that ring is not an integral domain.
Writing $n$ as a product of prime numbers and using the Chinese remainder theorem, we can reduce to the case where $n$ is a prime power, say $n = p^m$ for some $m \geq 1$.
Obviously, $\mathbb{Z}[i]/ p^m\mathbb{Z}[i]$ is not an integral domain when $m \geq 2$, since the image of $p$ there is nonzero and nilpotent. So $m$ must be $1$.
If $p = 2$, then $\mathbb{Z}[i]/2\mathbb{Z}[i]$ is not an integral domain, because the images of $1+i$ and $1-i$ are nonzero, yet their product is.
If $p \equiv 1 \pmod{4}$, then by a result from elementary number theory, $p$ can be written as a sum of two squares: $p =a^2 + b^2$. Actually, you can argue this directly from the fact that $\mathbb{Z}[i]$ is a UFD. Then $p = (a+bi)(a-bi)$, and again the images of $a+bi$ and $a-bi$ in the quotient ring are nonzero, but their product is.