Which primes have the form a squared + ab + b squared?
A companion to the sum-of-two-squares theorem
The prime case of Fermat's sum-of-two-squares theorem says that a prime is a sum of two nonzero integer squares exactly when it is two or is congruent to one modulo four.
A related representation replaces the square lattice of Gaussian integers with the triangular lattice of Eisenstein integers:
The original article presents an exploratory commutative-algebra proof. The argument below retains its three-stage structure while making the quotient maps, norm bounds, and strict ideal inclusions explicit. This is a companion representation theorem, rather than a claim that the result is new or that it logically contains the sum-of-two-squares theorem.
For example,
There is a quick necessary congruence: , so a prime with such a representation is either three or congruent to one. The harder direction is showing that every prime congruent to one has a representation.
The ring and its norm
Put
Then , and every element of has a unique expression with . Uniqueness follows because is nonreal.
Complex conjugation preserves , since . Define
For ,
Thus a nonzero element has a positive integer norm, and . An element is a unit exactly when its norm is one: its conjugate then supplies an inverse, while a multiplicative inverse forces the product of two positive integer norms to be one.
For , we will prove
Here is the ideal of multiples of . An ideal is maximal when it is proper and no ideal lies strictly between it and the whole ring.
Stage 1: factor a polynomial over a finite field
Why every ideal of the polynomial ring is principal
Let be a nonzero ideal of , and choose a nonzero polynomial of least degree. Divide any by :
The remainder also lies in , so minimality forces . Thus . The zero ideal is as well.
Consequently, for the monic quadratic , the ideal fails to be maximal exactly when factors into linear factors. If , then
Conversely, an ideal strictly between and the whole ring has a generator of degree one, and that generator divides .
When does the quadratic split?
For , a repeated root is impossible. A common root of and would be , but in .
By Fermat's little theorem,
The roots of , if present, are distinct and nonzero. Hence splits over exactly when it divides .
To determine that divisibility, work modulo . Since , we have .
- If , then is divisible by three, so .
- If , then , so the remainder is , which is nonzero and has degree less than two.
A prime greater than three is not divisible by three. This proves the first equivalence.
Stage 2: identify the quotient ring
Evaluation at gives a surjective homomorphism
Its kernel is . Indeed, division by the monic polynomial works with integer coefficients, giving . If , then , forcing .
Therefore
Reducing coefficients modulo gives
These are ring isomorphisms. A quotient by a proper ideal is a field exactly when that ideal is maximal. Hence is maximal in exactly when is maximal in .
One can also express this through the ideal correspondence: ideals containing a kernel correspond to ideals in the quotient by image and inverse image. It is the correspondence on ideals that is bijective; the original reduction homomorphism is generally not injective.
Stage 3: every ideal of R is principal
We need Euclidean division for the norm. Given complex , express it uniquely as with real . Round to nearest integers , and put . Then
and
For with , apply this to . With ,

The lattice picture motivates approximation, but the centered rounding estimate above supplies the strict norm bound. An arbitrary point in an uncentered fundamental rhombus need not have smaller norm than its edge length.
Now choose a nonzero element of a nonzero ideal with least positive norm. Dividing any by leaves . The strict norm bound forces . Thus . The zero ideal is principal too.
From a nonmaximal ideal to a norm representation
Suppose is not maximal. Since it is proper, there is an ideal
Write . Because , we have for some . Both factors are nonzero, and
The positive integer norm pairs can only be , , or . If , then is a unit, contradicting . If , then is associated to , contradicting .
Therefore . Write to obtain
Neither coefficient can be zero: otherwise a prime would be an integer square.
From a representation to a nonmaximal ideal
Conversely, suppose for . Since , we have . The ideal is proper because its generator has norm and is not a unit.
The inclusion is strict. If for some , then , impossible for a positive integer . Thus and
This proves the last equivalence.
Finish the exceptional primes
All three stages apply for . For , take . For , the congruence rules out a representation because two is not a square modulo three.
We have therefore proved the criterion for every prime, with the required nonzero coefficients. The central connection is that factorization of a polynomial modulo detects the failure of to remain prime in a larger ring, and the multiplicative norm turns that factorization into an integer representation.
Related articles
- Equating rational and irrational parts: proof and worked problems
- How to simplify nested square roots, with three worked examples
- Conditional probability: the formula, information protocols, and worked examples
- Integration by parts: formulas, proof, and four useful patterns
- Triple-angle identities: remember, derive, and apply them
About the author
Koki Saito
Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.
Full profile →Have a question or spotted an error? Contact us.