Skip to main content

Lucas' Theorem

Lucas' Theorem is a result in Combinatorics for finding \(\binom{n}{k} \bmod p\) when \(p\) is prime. It rewrites the numbers in base \(p\) and turns one big binomial coefficient into smaller digit-by-digit ones.

Last updated July 2026•Fiveable Content Team

What is Lucas' Theorem?

Lucas' Theorem is a shortcut for calculating a binomial coefficient modulo a prime number. In Combinatorics, that means you can figure out the remainder of (nk)\binom{n}{k} after division by pp without expanding huge factorials.

The setup is simple once you know the trick. Write both nn and kk in base pp, so each number becomes a string of digits. If n=nrnr−1…n0n = n_r n_{r-1} \dots n_0 and k=krkr−1…k0k = k_r k_{r-1} \dots k_0 in base pp, then

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

Each digit pair gives a smaller binomial coefficient, and you multiply those together.

This works because modular arithmetic and binomial coefficients interact nicely when the modulus is prime. If any digit of kk is larger than the matching digit of nn, that small binomial coefficient is zero, so the whole product is zero mod pp. That gives you a fast way to spot when (nk)\binom{n}{k} is divisible by pp.

A compact example makes the pattern clearer. To find (103) mod 2\binom{10}{3} \bmod 2, write 10 as 1010 and 3 as 0011 in base 2. One digit pair has ni=0n_i=0 and ki=1k_i=1, so (01)=0\binom{0}{1}=0. That means (103)\binom{10}{3} is even, so the remainder mod 2 is 0.

The theorem is especially useful when the numbers are large. Instead of doing a huge computation, you break the problem into base-pp pieces, use smaller binomial coefficients, and combine them with multiplication mod pp. That is why Lucas' Theorem shows up in counting problems, divisibility questions, and algorithmic settings where direct computation would be messy.

Why Lucas' Theorem matters in COMBINATORICS

Lucas' Theorem gives you a clean way to read modular patterns inside binomial coefficients, which is a big deal in Combinatorics when direct calculation is ugly or impossible by hand. It connects two topics you already see often in the course, binomial coefficients and modular arithmetic, and shows that counting formulas can hide number-theory structure.

It matters because many problems are not asking for the exact value of (nk)\binom{n}{k}. They ask whether it is divisible by a prime, what the remainder is, or which coefficients in a large row of Pascal's triangle are nonzero modulo pp. Lucas' Theorem turns those into base-representation questions, which is usually much faster.

It also gives a nice lens for spotting patterns. For example, with modulus 2, the theorem helps explain why some entries in Pascal's triangle are odd and others are even. That is a useful pattern in counting arguments and in topics that use binomial expansions.

If you are working on proofs or problem sets, this theorem is a bridge. It lets you move between the algebraic formula for (nk)\binom{n}{k} and digit-by-digit reasoning in base pp. That kind of move comes up a lot when a combinatorics problem feels like a counting question at first, but the real trick is arithmetic structure.

Keep studying COMBINATORICS Unit 3

Official unit cheatsheet

open one-pager

How Lucas' Theorem connects across the course

Binomial Coefficient

Lucas' Theorem is built around (nk)\binom{n}{k}, so you need the basic meaning of a binomial coefficient first. The theorem does not replace the coefficient, it gives you a faster way to evaluate it modulo a prime. If you already know symmetry, Pascal's triangle, and choosing arguments, Lucas' Theorem adds a modular arithmetic layer to the same object.

Modular Arithmetic

The whole theorem lives in modular arithmetic, because the goal is to find (nk) mod p\binom{n}{k} \bmod p. Instead of caring about the exact integer, you care about the remainder after division by a prime. That change in viewpoint is what makes the digit-by-digit product useful.

Base Representation

Lucas' Theorem depends on writing numbers in base pp. The digits are not just a formatting choice, they are the pieces the theorem multiplies together. A lot of confusion disappears once you keep track of the base correctly, especially when the base is not 10.

Vandermonde's Identity

Vandermonde's Identity is another way to combine binomial coefficients, but it works through summing products instead of breaking numbers into base-pp digits. They are not the same tool, but both show how binomial coefficients have structure beyond direct computation. Seeing both helps you compare different counting strategies.

Is Lucas' Theorem on the COMBINATORICS exam?

A problem set question might ask you to find (nk) mod p\binom{n}{k} \bmod p without a calculator-friendly expansion. Your job is to rewrite nn and kk in base pp, match the digits, and multiply the smaller binomial coefficients. If one digit of kk is too large, you can stop and answer 0 right away.

You may also use Lucas' Theorem in divisibility questions, where the task is to show that a binomial coefficient is divisible by a prime. In that case, the digit test is the cleanest move, because a single impossible digit pair forces the whole product to vanish mod pp. On quizzes, this often shows up as a short computation or a justification step, not a long proof.

Key things to remember about Lucas' Theorem

  • Lucas' Theorem finds (nk) mod p\binom{n}{k} \bmod p by breaking nn and kk into base-pp digits.

  • The theorem only applies when the modulus is a prime number.

  • If any digit of kk is bigger than the matching digit of nn, the binomial coefficient is 0 mod pp.

  • It is a fast way to handle large binomial coefficients without evaluating huge factorials.

  • The main skill is matching digits correctly in the right base before multiplying the smaller coefficients.

Frequently asked questions about Lucas' Theorem

What is Lucas' Theorem in Combinatorics?

Lucas' Theorem is a rule for computing binomial coefficients modulo a prime. You write the numbers in base pp, then multiply the smaller binomial coefficients from matching digits. It is a shortcut for modular counting problems.

How do you use Lucas' Theorem?

First, convert nn and kk into base pp. Then compute (niki)\binom{n_i}{k_i} for each matching digit pair and multiply the results modulo pp. If any ki>nik_i > n_i, the result is 0.

Why does Lucas' Theorem only work for prime moduli?

The theorem depends on properties of binomial coefficients modulo a prime, especially how the arithmetic behaves digit by digit. For composite moduli, the same clean product rule does not automatically hold. That is why the prime condition matters.

What is a common mistake with Lucas' Theorem?

The biggest mistake is forgetting to convert into the correct base before matching digits. Another common error is treating the digits like ordinary decimal pieces instead of base-pp digits. If the base is wrong, the whole product will be wrong.