One of the oldest questions in number theory asks which integers can be written as sums of squares. Typical examples are
Representation Problems
One of the oldest questions in number theory asks which integers can be written as sums of squares. Typical examples are
and
Such problems are called representation problems because they ask how integers may be represented by quadratic forms.
The simplest equation of this type is
where is a fixed positive integer and .
The goal is to determine for which integers the equation has integer solutions.
Squares Modulo Small Integers
Congruences provide strong restrictions on sums of squares.
Modulo , every square is congruent to either or :
Hence a sum of two squares can only be congruent to
Therefore no integer congruent to can be written as a sum of two squares.
For example,
so the equation
has no integer solutions.
Congruence arguments of this kind are fundamental throughout number theory.
Fermat’s Theorem on Two Squares
The complete characterization of primes representable as sums of two squares is given by the following theorem.
Theorem. An odd prime can be written in the form
with integers if and only if
For example,
But primes such as
cannot be expressed as sums of two squares because they are congruent to .
This theorem was stated by entity[“people”,“Pierre de Fermat”,“French mathematician”] and later proved rigorously by entity[“people”,“Leonhard Euler”,“Swiss mathematician”].
The General Criterion
The condition for arbitrary integers is more subtle.
Theorem. A positive integer can be expressed as a sum of two squares if and only if every prime congruent to
appears with even exponent in the prime factorization of .
For example,
The prime appears with exponent , which is even. Indeed,
Now consider
Both primes are congruent to , and both appear with odd exponent. Therefore cannot be represented as a sum of two squares.
Infinite Families of Solutions
Suppose
and
Then
This identity shows that the product of two sums of squares is again a sum of two squares.
The identity may be written compactly as
$$ (a^2+b^2)(c^2+d^2)
(ac-bd)^2+(ad+bc)^2. $$
This formula explains why factorization plays a central role in the theory.
It also reflects multiplication in the Gaussian integers
where
Indeed,
$$ (a+bi)(c+di)
(ac-bd)+(ad+bc)i. $$
The norm satisfies
and multiplication of norms yields the identity above.
Lagrange’s Four-Square Theorem
The study of sums of squares extends naturally beyond two variables.
A fundamental result states that every positive integer can be written as a sum of four squares.
Theorem. For every positive integer , there exist integers such that
For example,
This theorem was proved by entity[“people”,“Joseph-Louis Lagrange”,“French mathematician”] in the eighteenth century.
The analogous problem for three squares is more delicate. Certain integers cannot be represented as sums of three squares, specifically those of the form
Geometric Interpretation
The equation
describes a circle of radius . The problem asks which circles contain lattice points.
Similarly,
describes a sphere in three dimensions.
Thus the arithmetic theory of sums of squares becomes a problem about the distribution of lattice points on geometric surfaces. This interaction between algebra, geometry, and arithmetic is a recurring theme in modern number theory.