On this page
Suppose a problem asks for the remainder when C(1000, 300) is divided by 7. The number is far too large to write out, but Lucas's theorem turns the job into four tiny binomial coefficients you can do in your head.
The result first appeared in 1878 in papers by Édouard Lucas in the American Journal of Mathematics.
What does Lucas's theorem say?
Take a prime p and write n and k in base p, with digits n_i and k_i.
Lucas's theorem: C(n, k) ≡ C(n_m, k_m) × ... × C(n_1, k_1) × C(n_0, k_0) (mod p), with the convention that C(a, b) = 0 when b > a (statement on Wikipedia).
The key consequence: a prime p divides C(n, k) if and only if at least one base-p digit of k is greater than the matching digit of n (same source).
Why is (1 + x)^p ≡ 1 + x^p mod p?
This fact drives the proof, credited to Nathan Fine's 1947 paper, Binomial coefficients modulo a prime.
For 1 ≤ j ≤ p − 1, C(p, j) = p! / (j! (p − j)!) has p in the numerator but not in the denominator, whose factors are all smaller than p. So p divides it, and (1 + x)^p ≡ 1 + x^p (mod p).
Repeating this, (1 + x)^(p^i) ≡ 1 + x^(p^i) for every i.
Write n = n_m p^m + ... + n_0. Then (1 + x)^n is the product of ((1 + x)^(p^i))^(n_i), which is congruent to the product of (1 + x^(p^i))^(n_i).
Factor i expands to the sum of C(n_i, j) x^(j p^i). Base-p digits are unique, so x^k arises only from j = k_i in each factor i; if some k_i > n_i it cannot, matching C(n_i, k_i) = 0.
Compare coefficients of x^k: the left gives C(n, k), the right the product of C(n_i, k_i).
How do you find C(1000, 300) mod 7?
Convert 1000 to base 7. Since 7³ = 343: 1000 = 2 × 343 + 314, then 314 = 6 × 49 + 20, then 20 = 2 × 7 + 6. So 1000 = (2 6 2 6) in base 7. Check: 686 + 294 + 14 + 6 = 1000.
Convert 300: 300 = 0 × 343 + 6 × 49 + 0 × 7 + 6, so 300 = (0 6 0 6) in base 7. Check: 294 + 6 = 300.
Pair the digits: C(2, 0) × C(6, 6) × C(2, 0) × C(6, 6) = 1 × 1 × 1 × 1.
So C(1000, 300) ≡ 1 (mod 7).
The same row gives two more answers free:
C(1000, 30): 30 = (0 0 4 2) in base 7, and 4 > 2, so a factor C(2, 4) = 0 and 7 divides C(1000, 30).
C(1000, 3): 3 = (0 0 0 3), so C(6, 3) = 20 ≡ 6 (mod 7). Direct check: C(1000, 3) = 166,167,000 = 7 × 23,738,142 + 6.
You can even count: each k_i can be anything from 0 to n_i, so 3 × 7 × 3 × 7 = 441 of the 1001 entries are not multiples of 7.
If congruence notation still feels shaky, the Fermi Concept Library covers every concept in mathematics, so you can patch the gap first.
Why does Pascal's triangle mod 2 look like a Sierpiński triangle?
Set p = 2. The only one-digit binomial that vanishes is C(0, 1) = 0, so C(n, k) is odd exactly when every 1 in the binary form of k sits under a 1 in the binary form of n (Lucas's theorem, consequences).
The number of odd entries in row n is 2 raised to the number of 1s in n's binary form, a result James Glaisher showed in 1899, recorded in OEIS A001316. Row 1000 is 1111101000 in binary, with six 1s, so it has 2⁶ = 64 odd entries.
Now the shape. Row 2^m − 1 is all 1s in binary, so the whole row is odd; row 2^m has a single 1, so only its two ends are odd. Below that, the top block of 2^m rows reappears twice with an all-even triangle between. Repeat at every scale and you get the Sierpiński gasket, the picture random dots draw in the chaos game for the Sierpiński triangle.
A checklist for remainder problems
Prime modulus only. For prime powers the formulas get more complicated; for 10, work mod 2 and mod 5 and combine.
Pad k with leading zeros so the columns line up.
Any digit of k bigger than n's means the answer is 0.
Otherwise multiply the small binomials, reducing mod p as you go.
Test on a small row first.
If you keep slipping on the steps, the Fermi Problem Library has a step-by-step solver that explains the reasoning rather than printing an answer.
Next, read where the Fibonacci numbers hide in Pascal's triangle and what a primitive root modulo 7 is.



