Concept

Sums of two squares

The question of which whole numbers are a² + b², settled for the primes by their residue modulo four. The count of representations is a divisor sum, and the whole subject is the arithmetic of the Gaussian integers in disguise.

Named by 16 essays across 4 fields — each of them below, with the objects they name alongside it.

The circle of radius √25 on the integer lattice. A circle drawn on the whole-number grid, with the lattice points it passes through marked.

Two squares, and a lattice

Whether a prime is the sum of two squares is decided entirely by its remainder on division by four. A fact about circles is settled by a fact about remainders, and neither statement contains any hint of the other.

number · Sums of two squares
The two supplements, and the residue classes that decide them. A table of odd primes with the Legendre symbols of minus one and two beside the residue of p modulo four and modulo eight.

The two supplements, and where the eight comes from

The main law relates two odd primes to each other and says nothing about −1 or about 2. Those two are settled separately, by their own counts, and the answers arrive modulo four and modulo eight — which is a clue about where the whole subject is really taking place.

number · Quadratic reciprocity
Where a congruence decides which primes a form represents, and where it does not. Rows of primes marked by whether each is represented by x squared plus n y squared, with the residue classes that decide it where such classes exist.

Which primes a form takes

A prime is the sum of two squares exactly when it is 1 modulo 4. Change the form slightly, to x² + 27y², and no congruence on p decides it at all — which is where the elementary subject ends and its successor begins.

number · Quadratic reciprocity
The four-square identity, and how few squares a number needs. A product of two whole quaternions with both sides of the four-square identity evaluated, above a strip colouring every number by the fewest squares that add to it.

The identity that multiplies sums of squares

A sum of two squares times a sum of two squares is a sum of two squares, and the same is true of four and of eight. It is true of three of nothing: 3 and 5 are each a sum of three squares, 15 is not, and one small pair of numbers rules the case out forever.

algebra · Quaternions
The zeros of x² + y² + z² over GF(5), and of x² + y² over GF(7). Grids of every point over a small prime field with the solutions of a quadratic equation filled in: the three-variable equation drawn as one slice per value of z, beside a two-variable equation with far fewer solutions.

Solutions that come in multiples of p

Count the solutions of x² + y² + z² = 0 in the field with five elements and there are 25; with seven, there are 49. Whenever a system of equations has more unknowns than its total degree, its number of solutions is a multiple of the characteristic — which forces a solution besides zero, and the reason is a sum over the field that vanishes because its non-zero elements form one cycle.

computation · Finite fields
The two squares of 97, produced by division. A table of the division chain on 97 and a square root of minus one modulo it, with each row's quotient and remainder, the point at which the remainder falls below the square root marked, and the two squares that add to 97.

The two squares actually produced

Three proofs say a prime one more than a multiple of four is a sum of two squares, and not one of them hands over the squares. Running the Euclidean algorithm half-way does — and where to stop is the whole of the correctness argument.

number · Sums of two squares
How rare a sum of two squares is. Two curves against the logarithm of the bound: the fraction of numbers below it that are sums of two squares, falling; and that count times the square root of the logarithm, divided by the bound, which is nearly constant.

Almost no number is one

Sums of two squares look common — a sixth of all numbers up to a million are one. The fraction is falling to nothing, at a rate so slow that no computation will ever make it obvious, and the constant in front of it has been computed to fifty places and identified with nothing.

number · Sums of two squares
100 as three triangular numbers. 100 drawn as three triangles of dots with 36, 36 and 28 dots. There are 6 such decompositions.

Three triangular numbers, and no fewer

On 10 July 1796 Gauss wrote in his diary: ΕΥΡΗΚΑ — num = Δ + Δ + Δ. Every whole number is a sum of three triangular numbers. Two are not enough, and not by a little: the numbers that are sums of two thin out to a share of nought. Both facts are statements about squares in disguise, and one picture translates them.

geometry · Figurate numbers
The next sum of two squares after 150. A quarter of the circle of radius √150 on the integer lattice, with the column x = 12 and the first lattice point above the circle in it, (12, 3), on the circle of radius √153.

The wait for the next sum of two squares

Sums of two squares thin out to a share of nought, and yet the gaps between them stay short. Take the largest square below any number; what is left over is small, and a small number is always close to a square. Two squarings in a row say the next sum of two squares is never more than about 2√2 times the fourth root of n away — a bound proved in 1947 that nobody has improved, sitting far above every gap anyone has found.

number · Sums of two squares
From a rational point on x² + y² = 17 to a whole one. The circle of radius √17 on the integer lattice, a rational point on it, and 4 reflections through nearest lattice points, the denominators 3757, 205, 25, 5, 1, ending at (1, 4).

A fraction on the circle forces a whole point

If a number is a sum of two squares of fractions, it is a sum of two squares of whole numbers. Draw the circle, mark the rational point, join it to the nearest lattice point and follow the line to where it meets the circle again: the new point is rational too, with a smaller denominator. Repeat, and the denominators fall until they reach one. The argument needs no primes at all — only the fact that every point of the plane is within distance one of the lattice.

number · Sums of two squares
The plane of order 3 as a table, and the table times its transpose. The 13 × 13 incidence table of the projective plane of order 3 and its product with its transpose, which has 4 on the diagonal and 1 in every other cell.

The orders a plane cannot have

Every counting condition allows a projective plane of order six, and there is none. The proof that rules it out looks at one matrix identity — each point on seven lines, each two points on one — and turns it, by way of Lagrange's four squares, into the statement that six would have to be a sum of two squares. Run on the planes that do exist, the same argument hands back their orders as sums of two squares; run on six, it asks for something no arithmetic can supply.

computation · Finite geometry
456 pairs at one distance among 144 grid points. A 12-by-12 grid of points with 456 segments joining every pair at distance √25, in 6 directions.

How many pairs can be one apart

Place n points in the plane and count the pairs exactly one unit apart. A square grid with its spacing as the unit gives two pairs per point; the same grid with the unit chosen as a length it realises in many directions — the square root of 5, of 25, of 65, of 325 — gives three, five, eight. Counting points on circles caps the total at a constant times n to the four-thirds. Between that cap and the grids the truth has not moved since 1984, and at every size anyone can draw, the two look alike.

geometry · Inscribed angle
Each prime of the form 4k + 1 as a point on its own circle. Points (a, b) with a > b > 0 and a² + b² prime, for the 1125 such primes below 20000, filling the sector between 0° and 45°.

Which way a prime's two squares point

A prime one more than a multiple of four is a sum of two squares in exactly one way, and the two squares make a point on a circle. Draw that point for every such prime and ask which way it faces. It faces every way equally — the angles spread evenly over the sector, which Hecke proved by giving each angle a remainder and copying Dirichlet. Measured over seventy-four thousand primes, they are even more evenly spread than random angles would be.

number · Sums of two squares
Primes in five thousand thin sectors. 581517 primes in (2e7, 4e7] in 4967 sectors; mean 117.08, variance ratio 0.874, 2 empty.

Sectors that shrink with the primes

Hecke proved that the angles of the primes a² + b² are evenly spread, so every fixed sector eventually gets its share. Let the sector shrink as the primes grow, to width X^(−α), and the question is open beyond small α. Measured on the 581,517 such primes between twenty and forty million, wide shrinking sectors fluctuate far less than chance and thin ones as much as chance — and the thin sectors that go empty are not scattered: they gather beside the directions of small rational slope, most of all slopes like 1/3 and 1/1 whose two terms are both odd.

number · Sums of two squares
Even quartics never have the full group, and one step away almost all do. Even quartics x^4 + bx^2 + d to 20: reducible 199, S4 0, A4 0, D4 1338, C4 20, V4 124. With +x: reducible 157, S4 1524, A4 0, D4 0, C4 0, V4 0.

The quartics whose roots stay paired

A quartic can have five different Galois groups, and in a box of nearly fourteen million quartics they do not come in order of size. The eight-element group D₄ outnumbers the twelve-element A₄ thirty-five to one. Every even quartic has a smaller group than S₄, and moving one step off that plane restores the full group almost everywhere.

algebra · Galois correspondence
A walk on Gaussian primes stopped by a moat. Step ≤ 2 from 1 + i: 720 primes reached, farthest 17 + 42i at 45.310.

A walk on Gaussian primes stopped by a moat

Start at 1 + i and step from Gaussian prime to Gaussian prime, never more than 2 at a time: the walk reaches 720 primes and stops at 17 + 42i, surrounded by a moat. Allow steps of √10 and it reaches a quarter of a million primes before stopping at distance 1,024; steps of 4 carry it to 4,313. Whether some fixed step lets a walker reach infinity is a question Basil Gordon asked in 1962, and it is open.

number · Sums of two squares

Named alongside it

The objects these essays reach for when they reach for this one.

PrimesGaussian integersLatticeModular arithmeticNormQuadratic formCounting two waysDensityDescentExhaustive searchUnique factorisationAsymptotic

All concepts