Lucas 定理
For non-negative integers \(m\) and \(n\) and a prime \(p\), the following congruence relation holds:
\[\binom{m}{n} \equiv \prod_{i=0}^{k} \binom {m_i}{n_i} \pmod {p}, \]where
\[m=m_{k}p^{k}+m_{k-1}p^{k-1}+\cdots +m_{1}p+m_{0}, \]and
\[n=n_{k}p^{k}+n_{k-1}p^{k-1}+\cdots +n_{1}p+n_{0}, \]are the base \(p\) expansions of \(m\) and \(n\) respectively. This uses the convention that $ \tbinom {m}{n}=0$ if \(m < n\).
推论
A binomial coefficient \(\tbinom {m}{n}\) is divisible by a prime \(p\) if and only if at least one of the base \(p\) digits of \(n\) is greater than the corresponding digit of \(m\).
Lucas 定理的递归形式
对于非负整数 \(m\),\(n\) 和质数 \(p\) 设 \(m = ap + q\),\(n = bp + r\)(\(0\le q, r < p\) )则有
递归边界是 $ \tbinom{m}{0} = 1$ 和 \(\binom{m}{n} = 0\) 若 \(m < n\) 。