Home › Pascal's Triangle › Lesson 8

Legendre, Kummer and the p-adic Valuation

Lesson 8 of 14

Key idea of this section

vp(n!) = ∑i≥1 ⌊n/pⁱ⌋ = (n − sp(n))/(p − 1)
vp C(n, k) = (sp(k) + sp(n − k) − sp(n))/(p − 1) = number of carries in k + (n − k)

Legendre's formula

Theorem 8.1 (Legendre, 1808). vp(n!) = ∑i≥1 ⌊n/pⁱ⌋ = (n − sp(n))/(p − 1).

Proof. vp(n!) = ∑m=1n vp(m) = ∑m=1n #{i ≥ 1 : pⁱ ∣ m} = ∑i≥1 #{m ≤ n : pⁱ ∣ m} = ∑i≥1 ⌊n/pⁱ⌋. For the second form, if n = ∑ⱼ nⱼ pʲ then ⌊n/pⁱ⌋ = ∑j≥i nⱼ pj−i, and summing over i ≥ 1 gives ∑ⱼ nⱼ (pj−1 + ⋯ + 1) = ∑ⱼ nⱼ (pʲ − 1)/(p − 1) = (n − sp(n))/(p − 1). ∎

v₂(30!) = 15 + 7 + 3 + 1 = 26 = (30 − 4)/1        (30 = 11110₂)
v₅(30!) = 6 + 1 = 7 = (30 − 2)/4                   (30 = 110₅)

Kummer's theorem

Theorem 8.2 (Kummer, 1852). For 0 ≤ k ≤ n, vp C(n, k) equals the number of carries that occur when k and n − k are added in base p.

Proof. By Legendre, vp C(n, k) = vp(n!) − vp(k!) − vp((n − k)!) = (sp(k) + sp(n − k) − sp(n))/(p − 1). Now add a = k and b = n − k digit by digit with carries c₋₁ = 0, c₀, c₁, … ∈ {0, 1}: at position i, aᵢ + bᵢ + ci−1 = (a + b)ᵢ + p cᵢ. Summing over i gives sp(a) + sp(b) + ∑ᵢ ci−1 = sp(a + b) + p ∑ᵢ cᵢ, i.e. sp(a) + sp(b) − sp(a + b) = (p − 1) ∑ cᵢ. ∎

Kummer proved the theorem in his 1852 memoir on reciprocity laws; the digit-sum form makes it a one-line consequence of Legendre. Lucas' theorem is the special case "zero carries" read modulo p.

v₃ C(100, 50):  50 = 1212₃;  1212₃ + 1212₃ produces carries at all 4 positions
⟹ 3⁴ = 81 divides C(100, 50) exactly
v₂ C(100, 50) = s₂(50) = 3,   v₅ = v₇ = 0  (50 = 200₅ = 101₇; no carries)

Corollaries

Corollary 8.3. (i) v₂ C(2n, n) = s₂(n); in particular C(2n, n) is even for n ≥ 1 and divisible by 4 unless n is a power of 2. (ii) For every prime p and 0 ≤ k ≤ n, pvp C(n, k) ≤ n. (iii) C(n, k) divides lcm(1, 2, …, n), and therefore lcm(1, …, 2n) ≥ C(2n, n) ≥ 4ⁿ/(2n + 1).

Proof. (i) In n + n each binary 1 of n produces a carry (Kummer), or directly 2s₂(n) − s₂(2n) = s₂(n). (ii) If pᴸ⁻¹ ≤ n < pᴸ then n has L digits, and a carry out of position L − 1 would force n ≥ pᴸ; so there are at most L − 1 carries and pv ≤ pL−1 ≤ n. (iii) By (ii), every prime power exactly dividing C(n, k) is at most n and hence divides lcm(1, …, n). The last inequality holds because C(2n, n) is the largest of the 2n + 1 terms in the expansion of 4ⁿ = (1 + 1)2n. ∎

Part (iii) is the elementary route to Chebyshev-type bounds: it shows lcm(1, …, N) grows at least like 2N up to polynomial factors, i.e. ψ(N) = log lcm(1, …, N) ≥ N log 2 − O(log N).

Babbage and Wolstenholme

Theorem 8.4 (Babbage, 1819). For every prime p ≥ 3, C(2p − 1, p − 1) ≡ 1 (mod p²).

Proof. C(2p − 1, p − 1) = ∏k=1p−1 (p + k)/k = ∏k=1p−1 (1 + p/k). Working in the ring ℤ₍p₎ of rationals with denominator prime to p, the product is ≡ 1 + p ∑k=1p−1 1/k (mod p²). Pairing k with p − k, 1/k + 1/(p − k) = p/(k(p − k)), so the harmonic sum Hp−1 is divisible by p (for p ≥ 3, where the pairs are disjoint). Hence the product is ≡ 1 (mod p²). ∎

Wolstenholme (1862) proved more: for p ≥ 5, Hp−1 ≡ 0 (mod p²), which yields C(2p − 1, p − 1) ≡ 1 (mod p³), equivalently C(2p, p) ≡ 2 (mod p³). For p = 7: C(14, 7) = 3432 and 3432 − 2 = 3430 = 7³ · 10. Primes for which the congruence holds modulo p⁴ are called Wolstenholme primes; only 16843 and 2124679 are known.

Erdős's proof of Bertrand's postulate

Theorem 8.5 (Chebyshev, 1852). For every n ≥ 1 there is a prime p with n < p ≤ 2n.

Proof (Erdős, 1932). Step 1: ∏p≤m p < 4ᵐ for m ≥ 1. By induction it suffices to treat odd m = 2s + 1; the primes in (s + 1, 2s + 1] all divide C(2s + 1, s), which is at most 4ˢ because it appears twice in the expansion of 22s+1; hence ∏p≤2s+1 p < 4s+1 · 4ˢ = 42s+1. Step 2: write vp C(2n, n) = ∑i≥1 (⌊2n/pⁱ⌋ − 2⌊n/pⁱ⌋), each term being 0 or 1. Hence pvp ≤ 2n by Corollary 8.3(ii); primes p > √(2n) appear at most to the first power; and for n ≥ 5 primes with 2n/3 < p ≤ n do not divide C(2n, n) at all, because then ⌊2n/p⌋ = 2, ⌊n/p⌋ = 1 and p² > 2n. Step 3: suppose no prime lies in (n, 2n]. Then all prime factors of C(2n, n) are at most 2n/3, and

4ⁿ/(2n + 1) ≤ C(2n, n) ≤ (2n)√(2n) · ∏p ≤ 2n/3 p < (2n)√(2n) · 42n/3

where primes up to √(2n) (fewer than √(2n) of them) contribute at most 2n each. This gives 4n/3 < (2n + 1)(2n)√(2n), which is false for all n ≥ 468. For n < 468 (indeed for n < 631) the primes 2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631, each less than twice its predecessor, supply a prime in (n, 2n]. ∎

Exercise

  • (a)
    Find v₂ C(1000, 500).
  • (b)
    Find v₃ C(63, 26) by counting carries.
  • (c)
    Verify Babbage's congruence for p = 7.
Show solution

Answers: (a) s₂(500) = 6 (500 = 111110100₂), so v₂ = 6. (b) 26 = 222₃ and 63 − 26 = 37 = 1101₃. Adding 0222₃ + 1101₃: position 0: 2 + 1 = 3, write 0 carry 1; position 1: 2 + 0 + 1 = 3, write 0 carry 1; position 2: 2 + 1 + 1 = 4, write 1 carry 1; position 3: 0 + 1 + 1 = 2, no carry. Three carries, so v₃ C(63, 26) = 3 (and indeed 63 = 2100₃). (c) C(13, 6) = 1716 and 1716 − 1 = 1715 = 49 · 35.

V.3.1