Proposition (primes in integers and Gaussian integers)

Let $p$ be a prime in $\Z$. The following are equivalent:

  1. $p$ is not a prime in $\Z[i]$;

  2. $p$ is a sum of two squares, i.e. $p=a^2 + b^2$ for some $a,b\in \Z$;

  3. $p\equiv 1$ or $p\equiv 2\pmod 4$.

Proof