Modular arithmetic
Named by 57 essays across 10 fields — each of them below, with the objects they name alongside it.
Numbers that wrap
A clock does arithmetic. It has finitely many numbers, addition never leaves it, and multiplication behaves entirely differently depending on one property of the size of the dial.
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.
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.
Two dials at once
Watch one number on two clocks with different faces. If the faces share no factor, every pair of readings occurs exactly once — so two remainders name a number, and a hard calculation can be split into two easy ones.
Counting one rectangle, twice
Whether seven is a square modulo eleven, and whether eleven is a square modulo seven, are two unrelated-looking questions. Their answers are linked, and the link is a rectangle of dots counted along its rows and then along its columns.
Distance is a picture
A message is a corner of a cube and an error is a step along an edge. Everything a code can do is decided by how far apart the corners it uses are — and that is a fact about a drawing.
The field with four elements
The integers modulo four are not a field: two times two is zero and two has no reciprocal. There is nevertheless a field with four elements, and building it means giving up on counting as the way to make arithmetic finite.
Every element is a power of one of them
Pick the right element of a finite field and its powers run through every other non-zero element exactly once before returning to one. Multiplication becomes addition of exponents, and a table of q − 1 entries replaces the whole multiplication table.
Colours that count more than three
Three colours prove the trefoil is knotted and say nothing at all about the figure-eight, which refuses them exactly as an unknotted loop does. The repair is to stop colouring and start counting — with five colours, or seven, and with the arithmetic done modulo the number of them.
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.
The planes a recurrence cannot leave
One multiplication and one addition, taken modulo a fixed number, produce a sequence that passes for random one value at a time. Taken two or three at a time it does not, and the reason is a whole-number relation that pins every point onto one of a small family of parallel lines.
Eighteen people, and the seventeen that escape
Among any eighteen people, four are mutual acquaintances or four are mutual strangers. Seventeen can be arranged so that neither happens, and the arrangement is not a lucky find — it is a rule about squares.
Three in a row on the number line
Colour the numbers one to eight in two colours and it can be arranged that no three equally spaced numbers agree. Add the ninth and it cannot. The structure being forced is arithmetic rather than graphical, and the proof is a different proof.
A field's worth of squares
Two orthogonal squares of order five are easy to stumble on. Four of them, every pair orthogonal, is not a stumble — it is one line of arithmetic over a field, and the field supplies as many as the order allows.
Every fifth one divides
p(4) is 5, p(9) is 30, p(14) is 135, and every partition count at a number leaving four on division by five is divisible by five. Ramanujan read it off a table; the explanation is a way of splitting those partitions into five equal heaps.
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.
The symbol is the sign of a shuffle
Multiplying every residue modulo p by a fixed number rearranges them. That rearrangement is a permutation, permutations have a sign, and the sign is exactly the Legendre symbol — so a question about squares becomes a question about crossings.
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.
Almost every number comes down
The Collatz conjecture is open and a great deal about it is not. Whether a number falls below its own start in the first few steps is decided entirely by its remainder on division by a power of two, and the share of numbers for which it happens can be counted exactly.
The test that ranks the generators
Every linear generator's output lies on a family of parallel planes. Which generator is better is decided by how far apart those planes are, and that distance is the length of the shortest whole-number vector the modulus annihilates — a quantity that can be computed exactly rather than estimated by testing.
Four numbers and the rule is yours
A linear generator can be solved. Given a few of its outputs, the multiplier and the increment fall out of two congruences, and every future output is then known exactly — which is a failure of a completely different kind from the lattice defect, and is not detected by any test of how evenly the points are spread.
Randomness that has to be earned
A generator that resists prediction cannot be built out of a rule anybody can fit. It has to be built out of a computation believed hard to undo, and the belief is the load-bearing part — which makes cryptographic randomness a conditional statement rather than a construction.
Infinitely many of one kind
Euclid's argument produces a prime nobody had listed, and says nothing about what it looks like. Ask for infinitely many primes ending in 3, or leaving a remainder of 1 on division by 4, and the same construction has to be aimed — and for most targets nobody knows how to aim it.
Every pattern happens exactly once
Choose any sequence of odds and evens and there is exactly one residue class whose orbit follows it, and exactly one fraction that cycles through it forever. The Collatz conjecture is then the statement that only one of those infinitely many cycles is made of whole numbers.
Every class, and in equal shares
Euclid's argument aimed at a residue class reaches some classes and stalls at others. The theorem covering all of them is Dirichlet's, its proof abandons arithmetic entirely for analysis, and what it proves is stronger than infinitude — the classes are equal, though not at any point anybody has counted.
A remainder read two digits at a time
Lucas' theorem reads a binomial coefficient's remainder on division by a prime off its digits one at a time. On division by the prime's square the same reading is wrong at four odd entries in ten. What replaces it still reads digits — in overlapping pairs, with the prime taken out first and a sign that the carries decide.
Every third coefficient
Add every third number in the twelfth row of Pascal's triangle and the answer is 1366 — a third of 4096, rounded up. Which way the rounding goes is decided by two arrows of length one in the complex plane, and the same average over the roots of unity counts dice totals, subsets and necklaces.
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.
Give or take twice the square root
A cubic curve over the integers mod 43 should have about 44 points — one for each value of x, on average, and one at infinity. No curve misses by more than 13, the largest whole number below 2√43, and every count from 31 to 57 belongs to some curve. The first fact is Hasse's theorem, the second Deuring's, and the way the counts spread between the limits is a semicircle.
A method that is allowed to miss
Bhāskara's cyclic method solves x² − Dy² = 1 by aiming at the wrong target. It keeps a pair a, b with a² − Db² = k for some small k, combines it with a helper chosen so that k can be divided out, and repeats until k is 1. For D = 61 it reaches the ten-digit fundamental solution in 13 steps, where walking the convergents of √61 takes 22 — and for every D up to 100 it is faster.
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.
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.
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.
A plane in a list of numbers
A projective plane of order three has thirteen points and thirteen lines and fifty-two incidences. All of it is in the four numbers 0, 1, 3, 9 — because their pairwise differences hit every non-zero residue modulo thirteen exactly once, and the plane is that list's thirteen shifts.
A collision that finds a factor
A walk through the remainders modulo a number must eventually repeat, and it repeats modulo each hidden prime factor long before it repeats modulo the number. Pollard saw that the earlier repeat can be detected without knowing the prime — and that its timing is the birthday problem, so the cost is the square root of the factor.
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.
A factorisation that hides its primes
Keep only the whole numbers one more than a multiple of four. They multiply among themselves and nothing is lost — yet 441 is 9 × 49 and also 21 × 21, and every one of those factors is unbreakable there. Unique factorisation turns out not to be a fact about multiplication at all.
Eighteen equilateral triangles
Every angle of a triangle has three trisectors, not one, once the angle and its outside are both counted. Choosing one at each corner gives twenty-seven ways to cut out a triangle, and eighteen of them give an equilateral one. The nine that fail are exactly the choices whose labels add to 2, 5 or 8 — and all eighteen equilateral triangles have their sides in the same three directions, fixed by a third of the difference between two angles.
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.
A sum of two sets modulo a prime cannot be small
Add every element of one set of residues to every element of another. Over the whole numbers the sums always number at least |A| + |B| − 1. Modulo a prime the sums can wrap round and collide, and still they never number fewer — the theorem Cauchy proved in 1813 and Davenport again in 1935. Modulo 12 they can. A polynomial of low degree explains the difference in a paragraph.
Multiplying every number on the dial at once
Join every residue on a dial to twice itself and the chords draw a heart-shaped curve with one cusp; join each to three times itself and the curve has two. The picture is the whole multiplication map at once, and it holds three facts: the map splits the dial into cycles whose lengths are orders, those cycles on a dial of 2ⁿ − 1 are the binary necklaces of length n, and the curve is the caustic light draws inside a cup.
A root lifted one digit at a time
On a dial of seven, 3 × 3 is 2. On a dial of forty-nine the square root of 2 must reduce to 3, so there are only seven candidates, and exactly one of them works: 10. On a dial of 343 exactly one lift of 10 works: 108. Each step adds one digit on the left, found by solving a linear equation, and the digits go on for ever — a number …21216213 whose square is 2, in a world where closeness means divisibility by seven.
Arithmetic with addition alone
Over the real numbers, a quantifier's shadow is described by inequalities. Over the whole numbers with addition and multiplication, a shadow can be any set a computer can list. In between lies arithmetic with addition and no multiplication, and there the shadows are always the same kind of thing: a finite exception, then a pattern that repeats. The whole numbers made from coins worth 6, 9 and 20 are every number from 44 on; the squares, which need multiplication, never repeat at all.
Two counts that agree for no visible reason
Write 10 as a sum of whole numbers that differ from each other by at least two, and there are six ways. Write 10 as a sum of numbers that each leave 1 or 4 on division by 5, and there are six ways. The same happens for 20 (thirty-one each), for 40 (three hundred and seventy-four each), for every number anyone has checked and every number there is. The two lists look nothing alike, and no one has found a simple way to turn one into the other.
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.
How a polynomial breaks modulo the primes
Reduce x³ − 2 modulo a prime and it factors: into three linear pieces for some primes, one linear and one quadratic for others, not at all for the rest. Over the primes up to twenty thousand those three patterns occur a sixth, a half and a third of the time — exactly the shares of the identity, the flips and the rotations in the symmetry group of a triangle, the group that permutes the three cube roots of 2. A polynomial's factorisations modulo primes are a census of its Galois group.
A series that converges to minus one
1 + 2 + 4 + 8 + … runs off to infinity, and yet the formula for a geometric series says it should equal 1/(1 − 2) = −1. Measure size by how many factors of 2 a number has, instead of how large it is, and powers of 2 become small: the series converges, and to exactly −1. The same change of ruler explains why every repeating decimal is a fraction, and why repeating binary digits running off to the left are fractions too.
The row that proves a prime
Fermat's little theorem can be fooled: 561 passes it for every base and is not prime. Thread necklaces with a fixed number of black beads instead of any colours at all, and the count becomes a statement about a whole row of Pascal's triangle — every middle entry of row n is a multiple of n exactly when n is prime — which no composite can fake. Written as polynomials it is (x + a)ⁿ = xⁿ + a, and cut down to size it is the first proof that primes can be recognised in polynomial time.
Three sines tie a knot
Let a point move with a different sine wave in each of the three directions of space, the three frequencies whole numbers with no common factor, and it traces a closed curve that is usually knotted. With frequencies 2, 3 and 7 the curve is the knot 5₂. The trefoil, the simplest knot of all, can never be made this way: the half-turn that shifting time by half a period performs forces a condition on the knot's polynomial that the trefoil fails.
A rotation that hides the lattice
A congruential generator modulo a power of two has a lowest bit that alternates and pairs of outputs that lie on a few lines. Keep the generator exactly as it is, and show only eight bits of each state, rotated by an amount the state's own top bits choose: every output bit now runs the full cycle, the pairs fill the square as a random sequence would, and triples pass a test the state's own bits fail by a factor of six. Nothing about the state has changed, and four outputs still give it away.
Ten digits need a symmetry that does not commute
A check digit should catch one wrong digit and two neighbours swapped. Over eleven symbols a weighted sum does both; over the ten decimal digits no weighted sum can, no scheme of any shape built on adding modulo ten can, and the reason is the same as the reason Euler's thirty-six officers cannot be paraded. What works is the ten symmetries of a pentagon, which do not commute.
The quintics that have a formula
No formula solves every equation of degree five, and yet x⁵ − 2 is solved by a fifth root and x⁵ − 5x + 12 by a longer expression of the same kind. A quintic can be solved by radicals exactly when the symmetries of its roots fit inside one group of twenty — the maps x ↦ ax + b on the numbers modulo 5 — and two exact tests on its coefficients say whether they do.
The arcs that make the centre cheap
Finding a circle's centre with the compass alone, from two points on it, costs six circles when the points are placed with no special relation — and as few as two when the arc between them is 60°. Searching every arc in steps of five degrees maps the price exactly, and it is not a smooth function of the arc: it is a list of coincidences, each one a small number of compass steps that happens to land on a chord equal to the radius.
Euclid's proof run as a machine
Euclid proved there is no last prime by multiplying the primes on any list, adding one, and noting that the result has a prime factor not on the list. Run the proof as a machine — start from 2, and each time take the smallest prime factor of one more than the product so far — and it produces 2, 3, 7, 43, 13, 53, 5, 6221671, … a sequence that never repeats, that reaches small primes late and large ones early, and that nobody can prove reaches every prime.
A sum of factorials that converges at every prime
1 + 1 + 2 + 6 + 24 + 120 + … grows faster than any geometric series and has no sum in the real numbers. Measure size by divisibility instead and the same series converges at every prime at once, to a different number each time. Whether any of those numbers ends in zero is a question Đuro Kurepa asked in 1971, and a search through every prime below 100,000 says no while a coin-toss model says it should have said yes about twice.
Which knots a random loop ties
Long random loops are almost always knotted, but knotted as what? Sorting 14,000 closed random polygons by two values of the Alexander polynomial answers it. The trefoil leads at every length, five times as common as the figure-eight at 400 sticks. Each knot's share, divided by the unknotted share, grows like a power of the length, and the trefoil tied twice grows about twice as fast as the trefoil — what a loop carrying independent small tangles would do. Up to 300 sticks the double trefoil turns up exactly as often as two independent trefoils should.
Thirty-three as three cubes
Which numbers are a sum of three cubes, allowing negatives? Nothing like the rule for two squares is known — only that numbers leaving 4 or 5 on division by 9 are impossible. Every other number below a hundred has a sum with cubes under 5,000, except eight; 33 needed sixteen-digit cubes and was found in 2019.
Named alongside it
The objects these essays reach for when they reach for this one.
PrimesCounting two waysExhaustive searchCounting argumentCyclic groupQuadratic residueFinite fieldFermats little theoremLatticeSums of two squaresDensityExistence proof