Which primes are sums of two squares? and are, while and are not. In the question becomes one about factors, since : a prime is a sum of two squares exactly when it splits in into two factors of norm . The Gaussian integers form a PID (Theorem 12.3.4), and that settles the question.
- (i) An odd prime is a sum of two squares of integers if and only if .
- (ii) Up to units, the irreducible elements of are: ; the elements for which is a prime congruent to mod ; and the primes of that are congruent to mod .
Proof.¶
Idea. For (i), find an integer with . Then divides but neither factor, so is not prime in ; in a PID that means it is not irreducible, and a factor of of norm is a sum of two squares.
-
(i), only if: an odd sum of two squares is mod .
A square is or mod , since and . So a sum of two squares is , or mod , and an odd one is mod .
-
Wilson’s theorem: .
In the field (Theorem 10.2.6) every non-zero class has an inverse. A class is its own inverse exactly when , and has at most two roots in (Theorem 11.2.3), namely and , which differ because is odd. So the other non-zero classes fall into pairs with product , and the product of all non-zero classes, , is .
-
If , then has .
Pair each in with :
So by Wilson’s theorem , that is, .
-
Such a is not irreducible in .
In , . But divides neither factor: would need . So is not a prime element of , and since is a PID (Theorem 12.3.4), is not irreducible (Theorem 12.4.1).
-
(i), if: for some integers .
Since is neither nor , is a non-zero non-unit (Proposition 12.1.3). As it is not irreducible, with non-units. Then with neither factor , so , and gives .
-
(ii) The listed elements are irreducible.
has norm , and with has norm ; both norms are prime, so both elements are irreducible by Proposition 12.1.3 (iii). A prime has norm , so a factor that is not a unit would have norm , making a sum of two squares, which the first step rules out.
-
(ii) An irreducible of divides a prime of , and is or .
Its norm is an integer greater than , so it is a product of primes of , and divides this product in . Since is prime (Theorem 12.4.1), it divides one of these primes, . From , , so is or .
-
If , then is an associate of , and .
Then , is a unit, and is an associate of , so is irreducible in . Then , since , and , since otherwise by (i). So .
-
If , then is an associate of or one of the listed . This proves (ii).
Write , so . For , and are , and the four elements are the associates of . For odd , by (i), and is one of the listed elements .
, found from Wilson’s theorem
Here and , and indeed . The Euclidean algorithm in finds the common factor of and : dividing, , and then . So divides , with norm , and .
, which stays irreducible
, and the sums of two squares below are , so is not one. In the prime has no factor of norm , so it stays irreducible.
, the one even prime
: up to a unit, is the square of the irreducible . Since , the two conjugate factors of are associates.
Pierre de Fermat stated (i) in a letter to Marin Mersenne dated 25 December 1640, without proof. Leonhard Euler sent a proof to Christian Goldbach in 1749, and published it in two papers of the St Petersburg Academy, in its volumes for 1752–1755 (printed in 1758 and 1760).