Skip to main content
AMC 12 only

Binomial Coefficients & Number Theory

Binomial coefficients hide divisibility structure — Legendre's formula and Lucas's theorem both reach in and pull it out.

Valuation of a binomial coefficient

Since (nk)=n!k!(nk)!\binom{n}{k} = \dfrac{n!}{k!(n-k)!}, its prime valuation is just a difference of three Legendre’s-formula computations:

vp ⁣((nk))=vp(n!)vp(k!)vp((nk)!)v_p\!\left(\binom{n}{k}\right) = v_p(n!) - v_p(k!) - v_p((n-k)!)

A useful shortcut (Kummer’s theorem) restates this combinatorially: vp(nk)v_p\binom nk equals the number of “carries” when adding kk and nkn-k in base pp.

Lucas’s theorem

For a prime pp, Lucas’s theorem finds (nk)modp\binom nk \bmod p by working in basepp: write nn and kk in base pp as digit sequencesnin_i and kik_i, then:

(nk)i(niki)(modp)\binom{n}{k} \equiv \prod_i \binom{n_i}{k_i} \pmod p

with the convention (niki)=0\binom{n_i}{k_i} = 0 whenever ki>nik_i > n_i. This turns a potentially enormous binomial coefficient into a product of small, easy binomial coefficients on individual base-pp digits.

Worked example

Problem: Find (103)mod2\binom{10}{3} \bmod 2 using Lucas’s theorem.

Solution: Write 10 and 3 in base 2: 10=1010210 = 1010_2, 3=001123 = 0011_2. Compare digit by digit (from most to least significant): (10),(01),(11),(01)\binom10,\binom01,\binom11,\binom01.

The second factor is (01)=0\binom{0}{1}=0 (since ki>nik_i > n_i), so the whole product is 0.

So (103)0(mod2)\binom{10}{3} \equiv 0 \pmod 2 — i.e. (103)=120\binom{10}{3}=120 is even, which checks out directly.

Practice problems

1.Find v2((84))v_2\left(\binom84\right) using Legendre’s formula on 8!,4!,4!8!, 4!, 4!.

2.Use Lucas’s theorem to determine whether (62)\binom{6}{2} is odd or even (work mod 2).

3.Is (95)\binom{9}{5} odd or even? Use Lucas’s theorem base 2.

4.How many entries in row n=15n=15 of Pascal’s triangle are odd? (Hint: 1515 in base 2 is 11111111.)