theorem on sums of two squares by Fermat

Suppose that an odd prime number p can be written as the sum


where a and b are integers.  Then they have to be coprimeMathworldPlanetmath.  We will show that p is of the form 4n+1.

Since  pb,  the congruenceMathworldPlanetmathPlanetmathPlanetmath

bb1 1(modp)

has a solution b1, whence


and thus


Consequently, the Legendre symbolMathworldPlanetmath (-1p) is +1, i.e.

(-1)p-12= 1.

Therefore, we must have

p= 4n+1 (1)

where n is a positive integer.

Euler has first proved the following theorem presented by Fermat and containing also the converseMathworldPlanetmath of the above claim.

Theorem (Thue’s lemma (  An odd prime p is uniquely expressible as sum of two squares of integers if and only if it satisfies (1) with an integer value of n.

The theorem implies easily the

Corollary.  If all odd prime factors of a positive integer are congruent to 1 modulo 4 then the integer is a sum of two squares. (Cf. the proof of the parent article and the article “prime factorsMathworldPlanetmath of Pythagorean hypotenuses (”.)

Title theorem on sums of two squares by Fermat
Canonical name TheoremOnSumsOfTwoSquaresByFermat
Date of creation 2014-10-25 17:44:02
Last modified on 2014-10-25 17:44:02
Owner pahio (2872)
Last modified by pahio (2872)
Numerical id 13
Author pahio (2872)
Entry type Theorem
Classification msc 11A05
Classification msc 11A41
Classification msc 11A67
Classification msc 11E25