对于质数 \(p\),有
\[{\Large
\begin{aligned}
& \binom{n}{m} \equiv \binom{\left \lfloor n/p \right \rfloor }{\left \lfloor m/p \right \rfloor } \binom{n\mod{p}}{m\mod p} \pmod{p}
\end{aligned}
}
\]
引理1
\[{\Large
\begin{aligned}
& \binom{p}{n}\mod{p}=[n=0\vee n=p]
\end{aligned}
}
\]
引理2
\[{\Large
\begin{aligned}
& (a+b)^p \equiv a^p+b^p \pmod{p}
\end{aligned}
}
\]