For x³ − x − 1 no modulus predicts the pattern. An infinite product does: multiply out q∏(1 − qⁿ)(1 − q²³ⁿ) and its coefficients count the roots at every prime
Modulo a prime p, the cubic x³ − x − 1 has three roots, one root or none, and no rule of the form “look at p modulo m” predicts which. Yet there is a law. Multiply out a single infinite product, and the coefficient of qp gives the answer for every prime at once.
Press Play to multiply in one pair of brackets at a time and watch the coefficients settle from the left. Then switch to “Only the primes” and see which values survive.
Each tile is the coefficient of one power of q in the product so far: dark blue for −1, faint for 0, sky blue for 1, near-white for 2. Solid tiles are final; dashed, dimmed tiles can still change. Amber outlines mark prime exponents. Tap a tile to ask about it. Nothing here but multiplying brackets — no primes, no cubic, no number theory went in.
The product being expanded is q ∏ (1 − qn)(1 − q23n), taken over n = 1, 2, 3, …. It begins q − q² − q³ + q⁶ + q⁸ − q¹³ − q¹⁶ + q²³ − …. Multiplying it out needs no number theory at all, only patience: each bracket shifts a copy of what is already there and subtracts it.
Behind it is Dedekind’s eta function, η(z) = q1/24 ∏ (1 − qn) with q = e2πiz. The product here is η(z)η(23z): the two fractional powers of q, 1/24 and 23/24, add up to the single q in front. It is a modular form of weight 1 and level 23 — see also Modular Forms for what those words mean.
Euler’s pentagonal number theorem says that ∏ (1 − qn) = Σ (−1)k qk(3k−1)/2, summed over all integers k: almost every coefficient is 0 and the rest are ±1. That is how the page expands the product quickly, and why a single coefficient far out can be read off without computing the ones before it.
Step through the primes, or press Play to check every prime below 10,000: roots counted by trial on the left, a coefficient of the product on the right. Then try to break it with a random prime.
Amber is the arithmetic side: every residue is tried in x³ − x − 1, and each root is shown with the multiple of p it produces. Sky is the automorphic side: one coefficient of the multiplied-out product. The map has one cell per prime below 10,000, in order, turning emerald when the two sides agree (pale for three roots, mid for one, dark for none) and rose for the ramified prime 23. A mismatch would show rose too. Primes above 10,000 are off the map; their coefficient is computed on the spot from the two pentagonal series.
Write N(p) for the number of roots of x³ − x − 1 modulo p and a(p) for the coefficient of qp in the product. The law is N(p) = 1 + a(p) for every prime p other than 23, so a(p) is 2, 0 or −1 according to whether the cubic has three roots, one, or none. The demo checks it prime by prime, which is evidence; the statement for all primes is a theorem, and the third demo shows the classical reason.
The Galois group of this cubic is S₃, the six permutations of its three roots, which is not abelian. For such a polynomial no congruence condition on p can describe the pattern (see also Reciprocity Laws). In modern language, the two-dimensional representation of S₃ gives an Artin L-function, and it equals the L-function of the weight 1 modular form η(z)η(23z).
Hecke knew examples of this kind in the 1920s. In 1974 Deligne and Serre showed that every weight 1 newform comes from a two-dimensional Galois representation. The converse — that every odd two-dimensional representation of this kind comes from a weight 1 form — followed from Khare and Wintenberger’s proof of Serre’s conjecture (2009), with earlier cases due to Langlands and Tunnell (1980–81).
A count of solutions on one side, the coefficients of a very symmetric function on the other: this match is the Langlands correspondence in miniature.
Why does it work? Pick a prime from the strip and follow the two steps: is −23 a square modulo p, and if so, which form’s ellipse passes through a lattice point? Try 59, then 2, then 5.
| n | r1(n) | r2(n) | (r1 − r2)/2 | a(n) | agree |
|---|---|---|---|---|---|
| 1 | 2 | 0 | 1 | 1 | ✓ |
| 2 | 0 | 2 | −1 | −1 | ✓ |
| 3 | 0 | 2 | −1 | −1 | ✓ |
| 4 | 2 | 2 | 0 | 0 | ✓ |
| 5 | 0 | 0 | 0 | 0 | ✓ |
| 6 | 4 | 2 | 1 | 1 | ✓ |
| 7 | 0 | 0 | 0 | 0 | ✓ |
| 8 | 4 | 2 | 1 | 1 | ✓ |
| 9 | 2 | 2 | 0 | 0 | ✓ |
| 10 | 0 | 0 | 0 | 0 | ✓ |
| 11 | 0 | 0 | 0 | 0 | ✓ |
| 12 | 4 | 4 | 0 | 0 | ✓ |
| 13 | 0 | 2 | −1 | −1 | ✓ |
| 14 | 0 | 0 | 0 | 0 | ✓ |
| 15 | 0 | 0 | 0 | 0 | ✓ |
| 16 | 2 | 4 | −1 | −1 | ✓ |
| 17 | 0 | 0 | 0 | 0 | ✓ |
| 18 | 4 | 4 | 0 | 0 | ✓ |
| 19 | 0 | 0 | 0 | 0 | ✓ |
| 20 | 0 | 0 | 0 | 0 | ✓ |
| 21 | 0 | 0 | 0 | 0 | ✓ |
| 22 | 0 | 0 | 0 | 0 | ✓ |
| 23 | 2 | 0 | 1 | 1 | ✓ |
| 24 | 4 | 6 | −1 | −1 | ✓ |
| 25 | 2 | 0 | 1 | 1 | ✓ |
| 26 | 4 | 2 | 1 | 1 | ✓ |
| 27 | 4 | 2 | 1 | 1 | ✓ |
| 28 | 0 | 0 | 0 | 0 | ✓ |
| 29 | 0 | 2 | −1 | −1 | ✓ |
| 30 | 0 | 0 | 0 | 0 | ✓ |
| 31 | 0 | 2 | −1 | −1 | ✓ |
| 32 | 4 | 4 | 0 | 0 | ✓ |
| 33 | 0 | 0 | 0 | 0 | ✓ |
| 34 | 0 | 0 | 0 | 0 | ✓ |
| 35 | 0 | 0 | 0 | 0 | ✓ |
| 36 | 6 | 6 | 0 | 0 | ✓ |
| 37 | 0 | 0 | 0 | 0 | ✓ |
| 38 | 0 | 0 | 0 | 0 | ✓ |
| 39 | 4 | 2 | 1 | 1 | ✓ |
| 40 | 0 | 0 | 0 | 0 | ✓ |
| 41 | 0 | 2 | −1 | −1 | ✓ |
| 42 | 0 | 0 | 0 | 0 | ✓ |
| 43 | 0 | 0 | 0 | 0 | ✓ |
| 44 | 0 | 0 | 0 | 0 | ✓ |
| 45 | 0 | 0 | 0 | 0 | ✓ |
| 46 | 0 | 2 | −1 | −1 | ✓ |
| 47 | 0 | 2 | −1 | −1 | ✓ |
| 48 | 8 | 6 | 1 | 1 | ✓ |
| 49 | 2 | 0 | 1 | 1 | ✓ |
| 50 | 0 | 2 | −1 | −1 | ✓ |
| 51 | 0 | 0 | 0 | 0 | ✓ |
| 52 | 4 | 4 | 0 | 0 | ✓ |
| 53 | 0 | 0 | 0 | 0 | ✓ |
| 54 | 4 | 6 | −1 | −1 | ✓ |
| 55 | 0 | 0 | 0 | 0 | ✓ |
| 56 | 0 | 0 | 0 | 0 | ✓ |
| 57 | 0 | 0 | 0 | 0 | ✓ |
| 58 | 4 | 2 | 1 | 1 | ✓ |
| 59 | 4 | 0 | 2 | 2 | ✓ |
| 60 | 0 | 0 | 0 | 0 | ✓ |
The canvas shows the whole-number points (x, y) and the ellipse where the chosen form equals p; amber dots are points exactly on it, violet dots lie inside. Move over the lattice to read the form’s value at any point. In the strip, emerald primes have three roots, sky one, grey none, and rose is 23. In the table r1(n) and r2(n) count the points with Q₁ = n and Q₂ = n, found by listing lattice points; a(n) comes from multiplying out the product. Q₃ is the mirror image of Q₂ and takes the same values.
There are exactly three reduced quadratic forms of discriminant −23: Q₁ = x² + xy + 6y², Q₂ = 2x² + xy + 3y² and Q₃ = 2x² − xy + 3y². Q₂ and Q₃ are mirror images and take the same values. A prime p other than 23 is sorted in two steps. If −23 is not a square modulo p, the cubic has exactly one root and no form represents p. If it is a square, then either Q₁ represents p and the cubic has three roots, or Q₂ does and it has none.
Step 1 is governed by a modulus: it depends only on p modulo 23, which is quadratic reciprocity for the field Q(√−23). Step 2 is not. Which form represents p is invisible to congruences, and that is where the cubic’s unpredictability lives.
The three forms are the class group of Q(√−23), which has order 3, and the roots of x³ − x − 1 generate its Hilbert class field: a prime splits completely there exactly when it is represented by the principal form Q₁. Counting representations gives theta series θi = Σ qQi(x, y), summed over all integer pairs (x, y), and the identity checked in the table is η(z)η(23z) = ½(θ₁ − θ₂). So the mysterious product is a difference of two theta series, and theta series are modular forms.
Not every equation has such a classical explanation. The Langlands program conjectures that a matching automorphic object exists regardless.
Spot a mistake or have an idea?