## Primes And Square Sums

#### Problem

Prove that there exists no prime which is one less than a multiple of four that can be written as the sum of two squares.

#### Solution

Let `p` = `a`^{2} + `b`^{2}.

With the exception of `p` = 2 (which is not one less than a multiple of 4 anyway) all primes are odd. Hence one square must be even and one square must be odd for their sum to be odd.

So W.L.O.G. (without loss of generality) let `a` = 2`x` (even) and`b` = 2`y` + 1 (odd).

`a`^{2} = (2`x`)^{2} = 4`x`^{2}`b`^{2} = (2`y` + 1)^{2} = 4`y`^{2} + 4`y` + 1

`p` = 4`x`^{2} + 4`y`^{2} + 4`y` + 1 = 4(`x`^{2} + `y`^{2} + `y`) + 1 = 4`k` + 1

That is, an odd square and an even square always adds to a number which is one more than a multiple of 4. Hence we prove that no prime which is one less than a multiple of 4 can be written as the sum of two squares.

Note

It is important to realise that the proof given shows that an odd square added to an even square will produce a number of the form 4`k` + 1. It does not show that every number of the form 4`k` + 1 can be obtained by adding an odd and even square. For example, the number 9 is of the form 4`k` + 1, and this cannot be obtained by adding two squares. However, Pierre de Fermat (1601-1665) was able to prove that ALL primes of the form 4`k` + 1 can be written as the sum of two squares, but the proof for this is far beyond the scope of an elementary approach.