Lucas 定理

For non-negative integers $m$ and $n$ and a prime $p$, the following congruence relation holds:

$$inom{m}{n} equiv prod_{i=0}^{k} inom {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 $ binom {m}{n}=0$ if $m < n$.

推论

A binomial coefficient $ binom {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$($0le q, r < p$ )则有

$$ inom{m}{n} equiv inom{a}{b} inom{q}{r} pmod{p} $$

递归边界是 $ binom{m}{0} = 1$ 和 $inom{m}{n} = 0$ 若 $m < n$ 。

Reference

  1. https://en.wikipedia.org/wiki/Lucas's_theorem
原文地址:https://www.cnblogs.com/Patt/p/9371842.html