Let p be a prime integer. Under what condition is it a sum of two squares?
We will show that the condition is $p \equiv 1 \bmod 4$, or $p=2$. For $p=2$, it is obvious. Suppose $p>2$.

If $p$ is the sum of two squares, since a square is congruent to 0 or 1 modulo 4, we must have $p \equiv 1 \bmod 4$.

If $p \equiv 1 \bmod 4$, then as we have seen, -1 is a square modulo $p$. Therefore, there exists an integer $x$ strictly less than $p$ such that $p \mid x^{2}+1$. Suppose $p$ is a Gaussian prime. Then $p$ divides $x+i$ or $x-i$. However, $|x-i|^{2}=x^{2}+1 \geq(p-1)^{2}+1<p^{2}=|p|^{2}$, which is a contradiction. Therefore, $p$ is not a Gaussian prime. There exists $a+ib$ with $a, b \neq 0$ dividing $p$. Since $a-ib$ also divides $p$, $a^{2}+b^{2}$ divides $p$. Since $|a+i b|^{2} \mid p^{2}$, we have $|a+i b|^{2}=p$, so $\left|a^{2}+b^{2}\right|^{2}=p^{2}$, and thus $p=a^{2}+b^{2}$.

Proposition 69. If $p$ is a prime congruent to 3 modulo 4, then $p$ is a Gaussian prime.

Proof. By contradiction, there should exist $a+ib$ dividing $p$, so $p=a^{2}+b^{2}$, which is a contradiction.

Remark 70. Let $\omega$ be a primitive $n$-th root of unity. We can define $\mathbb{Z}[\omega]$ as the set of $a_{0}+a_{1} \omega+\cdots+a_{n-1} \omega^{n-1}$, and similar properties will hold. The case $n=3$ is sometimes useful.

## 2 Tuesday afternoon, 19th

## Diophantine Equations