# Let $p\in\mathbb{N}$ be prime. Prove that p is irreducible in $\mathbb{Z}[i]$ if and only if $p\equiv3$ $(mod$ $4)$. [duplicate]

I have already proven one direction, which is $$p\equiv3$$ $$(mod$$ $$4)$$ implies $$p$$ irreducible. Now, stating that $$p$$ is irreducible I can't get to the conclusion that $$p\equiv3$$ $$(mod$$ $$4)$$. I have tried many things but the one that got me closer to the solution was to suppose that $$p\not\equiv3$$ $$(mod$$ $$4)$$, and find a contradiction. I've found a contradiction in the cases where $$p\equiv2$$ $$(mod$$ $$4)$$ and $$p\equiv1$$ $$(mod$$ $$4)$$ for $$p$$ being an even prime number (i.e. $$2$$) but it's getting really difficult to prove the remaining statement, that is $$p\equiv1$$ $$(mod$$ $$4)$$ is not possible for $$p$$ odd prime.

To solve the first implication I've used that $$p$$ is compound (not irreducible) in $$\mathbb{Z}[i]$$ iff can be expressed as the sum of two squares, I don't know if it could come in handy again.

• Shouldn't the title read "Let $p \in \mathbb{Z}$..." [instead of "Let $p \in \mathbb{Z}[i]$...".] As the goal here is to show that an integer that is a prime in $\mathbb{Z}$, stays prime in the "larger" ring $\mathbb{Z}[i]$ iff $p$ meets certain conditions.
– Mike
Jan 5 at 17:40
• @Mike True, I edited it. Jan 5 at 17:41