Lucas' theorem

From Wikipedia, the free encyclopedia

In number theory, the Lucas' theorem states the following: Let m and n be non-negative integers and p a prime. Let

m=m_kp^k+m_{k-1}p^{k-1}+\cdots +m_1p+m_0, and
n=n_kp^k+n_{k-1}p^{k-1}+\cdots +n_1p+n_0

be the base p expansions of m and n respectively. Then

\binom{m}{n}\equiv\prod_{i=0}^k\binom{m_i}{n_i}\pmod p.