Count the solutions of an equation modulo each prime and a pattern appears. For x² + 1 it depends only on p mod 4 — the first reciprocity law — and Frobenius turns every prime into a permutation of the roots
Take an equation, and for each prime p ask how many solutions it has in clock arithmetic modulo p. The answers look random — until a pattern appears. For x² + 1 the answer depends only on the remainder of p on division by 4. Rules like that are called reciprocity laws, and the Langlands program is the search for the reciprocity law of every equation.
Step through the primes and watch every residue being tried as a root of x² + 1. Then press “Arrange by p mod m” and change m until the columns of tiles turn solid, and try the other polynomials.
Top: the residues 0 to p − 1 round a ring, each one tried in turn; roots light up amber. Point at a residue to see the value of the polynomial there. Bottom: the 303 primes up to 2000; tap a tile to send that prime to the ring. When arranged, a green bar marks a column whose primes all have the same number of roots, and the last column holds the primes dividing m. Rose tiles are the finitely many primes where the polynomial has a repeated root; they are left out of the tally.
In 1640 Fermat stated that an odd prime is a sum of two squares exactly when it leaves remainder 1 on division by 4: 5 = 1 + 4, 13 = 4 + 9, 17 = 1 + 16, but never 3, 7, 11 or 19. Euler gave the proof in 1749. The same primes are exactly the ones for which x² + 1 has a root modulo p, which is what the demo shows with m = 4. A question about one prime at a time is answered by a glance at its last two binary digits.
The general statement is the law of quadratic reciprocity. Euler and Legendre conjectured it; Gauss found the first proof in 1796 and published it in the Disquisitiones Arithmeticae (1801). One consequence is what the demo displays: for a fixed integer d, whether x² − d has roots modulo p depends only on the remainder of p modulo 4|d|. So x² − 2 is settled by p mod 8, and x² − 5 by p mod 20 — in fact by p mod 5.
The two cubics behave differently. For x³ − 2, the primes with p ≡ 2 mod 3 always give exactly one root, but the primes with p ≡ 1 mod 3 give sometimes three roots and sometimes none, and no modulus on offer separates them. For x³ − x − 1 only m = 23 sorts any column at all, and then only half of them. The third demo on this page takes up the question of whether a cleverer modulus could work. See also Quadratic Residues in the Number Theory module.
Move the prime slider to see how the polynomial factors modulo p, drawn as cycles on its roots, and press “Apply Frobenius” to send the roots round. Then let the race run and watch each bar settle on its dashed mark.
Top: the amber discs are the 3 roots of the polynomial in a large enough extension of the integers modulo p, numbered arbitrarily. Raising to the p-th power permutes them, and each irreducible factor is one cycle; a root that is an ordinary residue modulo p is a fixed point. Bottom: the race factors the polynomial modulo each prime up to 50,000 and fills one bar per cycle type. The dashed marks are exact: the number of elements of S₃ with that cycle type, over 6. Primes dividing the discriminant (0 so far) are left out.
The number of roots is a shadow of something richer: the way the polynomial factors modulo p. Modulo p, raising to the p-th power respects both addition and multiplication, so it carries roots of f to roots of f. This map is the Frobenius at p. It fixes exactly the ordinary residues modulo p, and it permutes the remaining roots, which live in larger finite fields. Each irreducible factor of degree d is one cycle of length d.
Dedekind’s theorem ties this to the Galois group of f, the group of symmetries of its roots over the rational numbers. For every prime p not dividing the discriminant, the Galois group contains an element whose cycle lengths on the roots are the degrees of the factors of f modulo p. That element is determined only up to conjugacy, which is why the roots in the diagram are numbered arbitrarily.
Frobenius’s density theorem (proved in 1880, published in 1896) says how often each pattern occurs: the proportion of primes with a given factorisation pattern equals the proportion of elements of the Galois group with that cycle type. Those are the dashed marks. Chebotarev’s theorem (1922) sharpens cycle types to conjugacy classes. The race is numerical evidence for a proved theorem, and it converges slowly: after N primes the bars still wobble by roughly 1/√N.
The slogan to carry forward: every unramified prime gives a conjugacy class in the Galois group, and those classes are the data that the Langlands program sets out to describe. See also the Galois Theory module.
Drag m and watch the pies round the wheel: a modulus works when every pie is a single colour. The scan tries every m up to 120. Compare x³ − 3x + 1, which succeeds at 9, with x³ − x − 1, which never does.
Each pie is one residue class of units modulo m, placed at its position on the clock, and shows the mix of factorisation patterns among the primes up to 20,000 in that class. Purity is the share of those primes lying in a class with a single pattern. Primes dividing m or the discriminant are left out. Point at a pie to read its contents; drag on the chart to move m. A finite sample can only show a modulus failing; that the abelian laws hold for every prime is a theorem.
A reciprocity law in the classical sense is a modulus m such that the way p splits depends only on p mod m. The Kronecker–Weber theorem says that every extension of the rational numbers with an abelian Galois group sits inside a cyclotomic field, one generated by a root of unity. In a cyclotomic field the Frobenius at p is simply “raise the root of unity to the p-th power”, which depends only on p modulo the order of the root. That is the source of every green bar in the scan: 4 for x² + 1, 5 for x² − 5, 9 for x³ − 3x + 1 (whose roots are 2 cos(2π/9) and its conjugates), and 5 and 7 for the cyclotomic polynomials themselves.
Class field theory, built by Takagi (1920) and completed by Artin’s reciprocity law (1927), extends this from the rational numbers to any number field, and it settles the question in both directions. If the splitting of primes is governed by congruences, then the Galois group must be abelian. So for x³ − x − 1, whose group is S₃, no modulus will ever work. The demo’s failure is a theorem, not a lack of patience.
The partial successes are abelian pieces of a non-abelian group. For x³ − 2, the residue of p mod 3 decides whether Frobenius is a swap, because the field contains the cube roots of unity; for x³ − x − 1, whose discriminant is −23, whether p is a square modulo 23 does the same job. What congruences cannot see is the difference between the identity and a rotation.
Something other than congruences has to describe those primes. In a letter to André Weil in January 1967, Robert Langlands proposed what that something should be. See also A Law Without a Modulus, where the answer for x³ − x − 1 is computed.
Spot a mistake or have an idea?