A remainder read two digits at a time
Worth reading first: Pascal's triangle, in two colours · The carries decide the divisibility.
Lucas’ theorem says that the remainder of a binomial coefficient on division by a prime can be read off the base- digits one column at a time: write and in base , take the small coefficient in each column, and multiply. Kummer’s theorem answers a different question exactly — how many times divides the coefficient — by counting carries. Neither says what the coefficient leaves on division by .
The natural guess is that the digit product keeps working one power higher. It does not, and the failure is not rare.
Modulo a prime power a binomial coefficient is still decided by its digits — but by the digits read in overlapping windows, after the prime has been taken out, and with a sign the carries decide. That is Granville’s theorem, and the reason it takes that shape is short enough to give in full.
Where the one-digit proof gives way
Lucas’ theorem has a two-line proof, and the place it stops is exactly one power of up.
Write in base . Then is the product of over the digits. Modulo , raising to the -th power is additive, so , and each factor becomes . The powers live in separate columns, so the coefficient of in the product is the product of one small coefficient per column — which is the theorem.
The step that needs care is . The coefficients thrown away are , and each of them is divisible by exactly once. Modulo they vanish. Modulo they survive: , and the is nought on a dial of two and not on a dial of four.
So modulo the columns are no longer separate. The surviving middle terms carry a contribution from one digit into its neighbour, and a rule that looks at one column at a time cannot see it. What that suggests, and what turns out to be true, is a rule that looks at two neighbouring columns at a time.
A remainder that needs two digits
Modulo 4 the failure has a particularly simple form, because in binary every small coefficient is , or , and all three are 1. The digit product for an odd entry is therefore always 1. An odd entry is 1 or 3 modulo 4, so the digit product is wrong at exactly the odd entries that leave 3 — the deep-coloured cells of the first figure, and the dots are on precisely those.
Which odd entries leave 3 is itself a statement about digits, and it is a statement about pairs. When is odd, the ones of sit under ones of , and takes the rest. Look at every place where has two ones side by side. Either takes both of them, or takes both, or they are split, one each. The entry leaves 3 on division by 4 exactly when an odd number of those adjacent pairs are split. The first figure checks that rule at every one of its 243 odd entries.
is an example. Thirteen in binary is , with one adjacent pair of ones at the top; four is and nine is , so four takes the lower one of the pair and nine the upper. One split pair, and . The digit product has no way to know that, because each column on its own looks the same whether the pair is split or not.
The digits come in windows
The table in that figure is the general rule at work. Each row reads a window of two consecutive digits — of , of and of — starting at a given place, and the windows overlap: the window starting at the second digit shares a digit with the one starting at the first.
For each window the rule takes the three numbers the windows spell, forms their factorials with every multiple of left out — written — and divides the first by the product of the other two, modulo . In the window from the third digit reads , and : three, one and two. Leaving out the even numbers, , and , so the ratio is 3. Every other window gives 1, the product is 3, and that is the remainder.
The rule in general, for the prime power , is Andrew Granville’s theorem of 1997. Read windows of digits. Take the product over all windows of the ratio of -free factorials. Multiply by once for every carry out of the -th column or any column above it, when and are added in base — except modulo 8 and the higher powers of two, where the sign is dropped. The result is the binomial coefficient with every factor of removed, modulo . With every window is a single digit, and when nothing carries the windows’ ratios are the small coefficients and the rule is Lucas’ theorem; when something does carry, it says what Lucas’ theorem cannot, namely what the coefficient leaves once its $p$s are gone.
Why a whole run of numbers counts only as a sign
The proof has two steps, and the second is where the windows and the sign come from.
First, take the prime out of each factorial. Among the multiples of are , whose product is times . So
and applying the same thing to , and again, writes as a power of times the product of over every . Doing that to , and gives as a power of — Kummer’s count of carries — times a ratio of -free factorials, one ratio per place . That identity is exact, in whole numbers, with no modulus anywhere.
Second, reduce each -free factorial modulo . A run of consecutive numbers contains one number from every remainder class, so the product of its members that does not divide is, modulo , the product of every unit on the dial of . By the extension of Wilson’s theorem that product is — for every odd prime power and for 4, with one family of exceptions that the next section is about. So modulo depends only on the last digits of , apart from a factor of for every complete run — and those last digits of are exactly the window starting at place .
The $-1$s have to be counted. For each place, the numbers of complete runs in , and differ by one exactly when a carry crosses into the column where the runs are counted, so the signs that do not cancel number one per carry out of the -th column or higher. That is the whole of the theorem. The windows are what a modulus of can remember of a factorial; the sign is what it cannot.
The exception that proves where the sign comes from
The product of the units modulo is for every odd prime power and for 4. It is not modulo 8: the units are 1, 3, 5 and 7, and , which leaves 1.
The reason is the proof of Wilson’s theorem itself. Pair every unit with its inverse; the pairs multiply to 1, and what is left is the product of the units that are their own inverses. Modulo a prime there are two of them, 1 and , and the product is . Modulo 8 there are four — every unit squares to 1, since , and all leave 1 — and their product is .
That happens because the units modulo 8 are not all powers of one of them: no unit has order four, so the group is not a cycle, and a cycle is what forces a single element of order two. Every odd prime power has a cycle of units, and so does 4; no higher power of 2 does. So Granville’s rule carries its sign for every prime power except with , where the sign is dropped — and the exception is not a patch on the theorem but a fact about which dials have a primitive root, arriving in a question about Pascal’s triangle.
Taking the prime out first
When the coefficient is divisible by the rule describes what is left after the $p$s are removed, and the figure below takes the pair the essay on carries used, in base five.
The table reads the windows , , of one hundred, , , of thirty-seven and , , of sixty-three — each window sliding one digit along from the last. The product of the ratios is 21 modulo 25, the sign flips it to , which is 4, and the figure checks that against the coefficient itself: is , and the second factor does leave 4.
Two facts come out of that, and neither is visible from Lucas’ theorem or Kummer’s alone. The coefficient’s remainder modulo 25 is nought, which says nothing. Its remainder modulo 125 is , because the part left after removing the fives is 4 modulo 5. Kummer supplies the power of the prime; Granville supplies the digits of what the power multiplies. Together they fix the coefficient’s last digits in base to as many places as the carries plus the width of a window: first the trailing noughts Kummer counts, one per carry, then more digits read from the windows.
The same failure in base three
In base three the small coefficients are no longer all 1 — — so the digit product takes more values than in base two, and it is still wrong.
The hues repeat on blocks of three, nine and twenty-seven rows exactly as the triangle modulo three did, because hue is what one digit at a time decides. The depths are a different matter. A window of two digits straddles the boundary between one block and the next, so the second digit of a remainder in a lower block depends on the leading digit of together with the digit below it — and a block that copies the one above it in hue need not copy it in depth. It already fails in base two at the smallest scale: rows 2 and 3 copy rows 0 and 1 in hue, and stands where stood. In base three the one-digit rule is wrong at 93 of 216 units; that is 43 in a hundred, close to the 41 in a hundred it was wrong at in base two.
The count is not a sign of disorder. Every one of those 378 remainders is computed by a rule with no exceptions, and the figure checks each against the entry itself. What is lost modulo is not structure but the independence of the columns.
Rows that repeat much further than they need to
Lucas’ theorem has one consequence that looks like it should be the end of the story: and leave the same remainder modulo , because appending a nought to both and in base appends a column whose small coefficient is . Every -th row of the triangle, read at every -th place, is the triangle again, modulo .
It is the triangle again to far more precision than that.
For every prime from five on, and agree modulo . Charles Babbage proved the case modulo in 1819, Joseph Wolstenholme raised it to in 1862, and the general form for every and came in the middle of the twentieth century, from Wilhelm Ljunggren and Ernst Jacobsthal.
The Babbage–Wolstenholme case has a proof that shows where the cube comes from. Write
working modulo with meaning the inverse of on that dial. The terms from on vanish, and two correction terms are left.
The first needs the sum of the inverses to be a multiple of . Pair with : , so the sum is times half the sum of the fractions — and modulo each of those is . The second needs the sum over pairs to be a multiple of , and that sum is half of the square of the first sum minus the sum of the squared inverses. Both come down to one fact: the squared inverses add up to a multiple of . They run over the same values as the squares , whose sum is a multiple of as soon as the six in the denominator shares no factor with — from five on, and not before.
For the argument runs out a step early, and the second figure shows the exact place. is , divisible by three once and not twice, so the -term survives modulo 27 and the agreement stops at nine. The shaded cells are where it stops, and the first of them is the entry the proof names: and differ by eighteen.
Where the rule needs its hypotheses
The modulus must be a prime power. A remainder modulo 12 is a remainder modulo 4 and a remainder modulo 3 read together, so a composite modulus is handled by running the rule once per prime power and assembling the answers. There is no single base in which the digits of a composite modulus live, which is why no single digit rule exists for it.
The prime is removed before the rule speaks. Granville’s theorem describes the coefficient divided by its full power of , not the coefficient. When that power is or more the remainder modulo is simply nought and all the information is in what the power multiplies — as showed, where the useful statement was about the remainder modulo 125.
The sign depends on the dial. It is there for every odd prime power and for 4, and absent for 8, 16 and every higher power of two, for the reason a group of units without a generator has more than one element of order two.
The windows grow with the modulus and the work does not grow much. Modulo each window has digits and there is one window per digit of , so the rule costs a few small factorials per digit — a computation on digits, against a coefficient with about of them, which is the same saving the carry count made for the power of .
Two digits of shading, and a rule with no such limit
The shaded triangles have two digits of remainder to show and a colour for each, which is why they stop at : modulo 27 there would be three digits and no honest way to shade the third. The worked table has no such limit, and the rule it computes has none; the figures that draw every entry simply do not go further than a picture can carry.
The pictures also check finitely many cases. Thirty-two rows modulo four and twenty-seven modulo nine is 906 entries, each computed by the rule and compared with the entry; the comparison of every fifth row with the triangle runs to . That is evidence the rule was implemented correctly. The proof above is what makes it true.
And the split-pair description of the remainder modulo 4 is special to base two. It works because every binary window of an odd entry is either split, unsplit or something whose factorials are all 1; in base three the ratio for a window takes more values, and the rule has no description in words as short as that one.
Still open: one power beyond the cube
The Babbage–Wolstenholme congruence says leaves 1 modulo for every prime from five on. For most primes it does not leave 1 modulo . The primes for which it does are called Wolstenholme primes, and only two are known — 16,843 and 2,124,679 — although a heuristic count suggests there are infinitely many of them, appearing more and more rarely.
The converse is open too. Every prime from five on satisfies the congruence modulo ; no composite number is known for which leaves 1 modulo , and nobody has proved that none exists. If none does, the congruence is a test for primality stated entirely in terms of one entry of Pascal’s triangle — the same shape of statement as Wilson’s characterisation, and like it, far too slow to use.
A rule that fails may have been read too finely
The habit is about what to do when a clean rule stops working one step further out.
Lucas’ theorem fails modulo , and the tempting conclusion is that the remainders modulo have no digit rule — that above the first power the triangle turns arithmetic into noise. The dots in the first figure look like evidence for it. The rule that replaces it is still a digit rule; it reads the digits two at a time instead of one. The one-digit rule was not wrong about the kind of answer, only about its width.
That is a common shape, and worth checking for before reaching for a different kind of explanation. When an argument that works column by column breaks, find the term that couples neighbouring columns — here the middle coefficients of — and ask how far the coupling reaches. If it reaches one column, read pairs; if it reaches columns, read windows of . The failure measured how wide the rule had to be.
What links here
Computed from the collection, not written here: the essays that point at this one.
Shares its objects with
Essays that name at least two of the same things, and that neither author linked.
- Always one before the double — both name binomial coefficient, divisibility, primes
- Numbers that wrap — both name cyclic group, modular arithmetic, primes
- Counting one rectangle, twice — both name modular arithmetic, primes
- Every fifth one divides — both name divisibility, modular arithmetic
- One way to factor, and no other — both name divisibility, primes
- The blocks a subgroup cuts out — both name cyclic group, modular arithmetic
Named objects
A dashed tag is an object no other essay names yet.
Binomial coefficientCyclic groupDivisibilityKummer's theoremLucas' theoremModular arithmeticPlace valuePrimes