Kummer's theorem 2026-10-18
For a prime number and integers , the P-adic valuation of the binomial coefficient equals the number of arithmetic carries in the base- addition of and .[ref] Indeed, subtract the two denominator factorial valuations in the Legendre formula:
Each arithmetic carry accounts for one unit of this quotient by subadditivity of the base-p digit sum. In particular, the binomial coefficient is divisible by exactly when at least one carry occurs.
For , the factorial counts give
The matching base-p expansions are and . Their units add to two; the next column gives , sending one carry into the nines column. That column then gives , and no further carry occurs. The result is . The base-p digit sums check the same result: . Consequently is divisible by three but not by nine.
Figure 1. . On the left, the base-p expansion gives . On the right, has exactly one carry, from the threes column into the nines column. Kummer's theorem therefore gives . Details.
Legendre's formula Created 2026-10-14 Updated 2026-10-18
For a nonnegative integer and a prime number , the Legendre formula computes the prime exponent in a factorial without forming that huge product:
Here is the floor function. The sum is finite: every term with is zero. When , all terms vanish, agreeing with and . The prime number hypothesis matters: a composite number does not give the same P-adic valuation or additive prime exponent. For example, the floor sum with is one, whereas divides .
Why count multiples repeatedly? Each multiple of in contributes one factor of ; each multiple of contributes another; and so on. A factor with P-adic valuation occurs in exactly the first counts. Adding those contributions proves the formula.[ref]
For the original example ,
The five multiples each contribute a second factor of three. The factor contributes a third, so it appears in all three rows. Equivalently, among there are eleven factors of P-adic valuation one, four of valuation two, and one of valuation three: . Thus divides , while does not.
Figure 1.
Nested multiples count the factors of three in
. Each colored cell contributes one to the P-adic valuation. Multiples of nine occur in two rows, and occurs in three. Summing by rows gives ; summing by columns gives . Factors not divisible by three contribute zero and are omitted. Details.
Repeated Euclidean division provides a practical evaluation: replace by , starting from , and add each new quotient until it is zero. This uses only the successive quotients for the example. The same calculation handles divisibility of binomial coefficients, where the P-adic valuations of the denominator factorials are subtracted.