Generator

Necklaces of 5 beads in 2 colours

A generator in the number library, called 34 times across 9 essays. Below: what it draws with nothing chosen and at each mode an essay asks for, what it checks while drawing, and everywhere it is used.

necklace is one function. Everything below came out of it during this build, at parameters taken from the essays rather than invented for this page — so a figure here is the same figure a reader meets in an essay, and if the generator changes, this page changes with it.

With nothing chosen

Necklaces of 5 beads in 2 colours. Every string of beads, grouped by the rotations that carry one onto another.

A witness that 97 is prime: 5 has order 96

A witness that 97 is prime: 5 has order 96. A table of the checks Lucas's test makes on 97 with base 5: the power (n − 1)/q for each prime q dividing n − 1, none of which is 1.

The largest order mod n, for n up to 200: only primes reach n − 1

The largest order mod n, for n up to 200: only primes reach n − 1. A scatter of the largest multiplicative order modulo n against n for n up to 200, with the line n − 1 dashed; the primes lie on the line and every composite lies below it.

A primality certificate for 1009: 8 nodes

A primality certificate for 1009: 8 nodes. A tree with 1009 at the root and below each prime the prime factors of one less than it, each node giving a base whose order proves that node prime.

The share of bases that witness a prime, for primes up to 2000

The share of bases that witness a prime, for primes up to 2000. A scatter of φ(p − 1)/(p − 1) against p for the primes up to 2000, the fraction of bases that have the largest possible order.

Every string of 5 beads in 2 colours

Every string of 5 beads in 2 colours. All the strings, sorted so that rotations of the same necklace sit together.

What it checks while it draws

Collected by running the family and recording what it asserted, not written here. The count is how many separate times the claim was put to the test while these drawings were made.

Where it is called

Every figure on this list is drawn by the same rule, so a change to the rule changes all of them at once. That is why the list is published.

Number

An order that proves a prime

Fermat's little theorem is a test that primes pass and composites mostly fail, and it can be fooled. Run backwards, it cannot. If some number a has order exactly n − 1 modulo n, then n is prime — because only a prime has n − 1 numbers to cycle through. Checking that takes the prime factors of n − 1, which need proofs of their own, and the proofs nest into a tree that anyone can check: Pratt's certificate, which shows every prime has a short proof of being one.

Algebra

Colourings nobody can tell apart

Sixteen ways to colour four corners in two colours, and only six of them are genuinely different. The count can be got by pooling the sixteen — or by never forming a single class and instead averaging how many colourings each motion leaves untouched.

Computation

Every word once, around a cycle

A cyclic string of eight bits holds all eight three-bit words, each exactly once — and the reason such a thing exists is that the constraint linking overlapping windows is itself the construction.

Number

Necklaces that prove a theorem

Thread five beads in two colours, thirty-two ways. Two of them are all one colour; the other thirty fall into rings of five. That count, and nothing else, is Fermat's little theorem.

Number

One residue whose powers are all of them

Fermat's theorem says every order divides p − 1. It does not say that anything has order exactly p − 1, which is a separate and stronger claim — and what forces it is a count of how many numbers share each divisor with p − 1.

Algebra

The blocks a subgroup cuts out

Take any part of a group that is closed under composition, and it slices the whole group into blocks of its own size that do not overlap. Everything Lagrange's theorem says is arithmetic about that picture — and whether the blocks can be multiplied is a separate question with a surprising answer.

Number

The exponent that is smaller than Euler's

Euler's theorem raises every unit to the count of the units and gets one. The smallest exponent that works for all of them at once is often much smaller — and a composite is invisible to Fermat's test exactly when that smaller number divides n − 1.

Dynamics

The orbit written as a word

Cut the interval in two and record which half each step of an orbit lands in. The orbit becomes an infinite string of two letters, the map becomes the act of deleting the first letter, and questions about trajectories turn into questions about words.

Number

Two primes where Fermat holds twice

Fermat's theorem says p divides 2^(p−1) − 1. Usually p² does not. It does at 1093 and at 3511 and at no other prime anyone has found, in searches reaching past 10^19. The leftover, (2^(p−1) − 1)/p taken mod p, behaves like a random number, so a prime has about a one-in-p chance of the extra divisibility — and a random count with that chance grows so slowly that two by now is unremarkable, while nobody can prove there are any more, or that there are infinitely many primes where it fails.

The whole library · What the figures prove