AoPSWiki
Want to learn how to tackle those tough AMC/AIME/Olympiad counting and probability problems? Check out Art of Problem Solving's NEW Intermediate Counting & Probability by David Patrick.
Personal tools

Lucas' Theorem

From AoPSWiki

Lucas' Theorem states that for any prime and any positive integers , if (\overline{n_mn_{m-1}\cdots n_0})_p is the representation of in base and (\overline{i_mi_{m-1}\cdots i_0})_p is the representation of in base (possibly with some leading s) then \binom{n}{i}\equiv \prod_{j=0}^{m}\binom{n_j}{i_j}\pmod{p}.

Contents

Lemma

For prime and ,

(1+x)^{p^r}\equiv 1+x^{p^r}\pmod{p}

Proof

For all , . Then we have

\begin{eqnarray*}(1+x)^p&\equiv &\binom{p}{0}+\binom{p}{1}x+\binom{p}{2}x^2+\cdots+\binom{p}{p-1}x^{p-1}+\binom{p}{p}x^p\\&\equiv& 1+x^p\pmod{p}\end{eqnarray*}

Assume we have (1+x)^{p^k}\equiv 1+x^{p^k}\pmod{p}. Then

\begin{eqnarray*}(1+x)^{p^{k+1}}&\equiv&\left((1+x)^{p^k}\right)^p\\&\equiv&\left(1+x^{p^k}\right)^p\\&\equiv&\binom{p}{0}+\binom{p}{1}x^{p^k}+\binom{p}{2}x^{2p^k}+\cdots+\binom{p}{p-1}x^{(p-1)p^k}+\binom{p}{p}x^{p^{k+1}}\\&\equiv&1+x^{p^{k+1}}\pmod{p}\end{eqnarray*}

Proof

Consider . If (\overline{n_mn_{m-1}\cdots n_0})_p is the base representation of , then for all and n=n_mp^m+n_{m-1}p^{m-1}+\cdots+n_1p+n_0. We then have

\begin{eqnarray*}(1+x)^n&=&(1+x)^{n_mp^m+n_{m-1}p^{m-1}+\cdots+n_1p+n_0}\\&=&[(1+x)^{p^m}]^{n_m}[(1+x)^{p^{m-1}}]^{n_{m-1}}\cdots[(1+x)^p]^{n_1}(1+x)^{n_0}\\&\equiv&(1+x^{p^m})^{n_m}(1+x^{p^{m-1}})^{n_{m-1}}\cdots(1+x^p)^{n_1}(1+x)^{n_0}\pmod{p}\end{eqnarray*}

We want the coefficient of in . Since i=i_mp^m+i_{m-1}p^{m-1}+\cdots+i_1p+i_0, we want the coefficient of (x^{p^{m}})^{i_{m}}(x^{p^{m-1}})^{i_{m-1}}\cdots (x^p)^{i_1}x^{i_0}.

The coefficient of each comes from the binomial expansion of , which is . Therefore we take the product of all such , and thus we have

\binom{n}{i}\equiv\prod_{k=1}^{n}\binom{n_k}{i_k}\pmod{p}

Note that n_k<i_k\Longrightarrow\binom{n_k}{i_k}=0\Longrightarrow\binom{n}{i}\equiv 0 \pmod{p}.

This is equivalent to saying that there is no term in the expansion of (1+x)^n=(1+x^{p^m})^{n_m}(1+x^{p^{m-1}})^{n_{m-1}}\cdots(1+x^p)^{n_1}(1+x)^{n_0}.

See also

Preparing for MATHCOUNTS or the AMC contests, and having a tough time with number theory problems? Read Art of Problem Solving's Introduction to Number Theory by Mathew Crawford.
© Copyright 2008 AoPS Incorporated. All Rights Reserved. • FoundationPrivacyContact Us