引理1:(x^p equiv x (mod p)),(p)是素数(费马小定理)
证明略
引理2:((a + b)^n = sumlimits_{i = 0}^n inom{n}{i} a^i b^{n - i})
证明略
定理1:((x + 1)^p equiv x + 1 equiv x^p + 1 (mod p))
由引理1可得
定理2:(inom{n}{m} equiv inom{lfloor frac{n}{p} floor}{lfloor frac{m}{p} floor} inom{n mod p}{m mod p} (mod p))
证明:
((x + 1)^n equiv (x + 1)^{lfloor frac{n}{p} floor imes p} imes (x + 1)^{n mod p} equiv (x^p + 1)^{lfloor frac{n}{p} floor imes p} imes (x + 1)^{n mod p} (mod p))
两边用二项式定理展开,
得(sumlimits_{i = 0}^n inom{n}{i} x^i equiv (sumlimits_{i = 0}^{lfloor frac{n}{p} floor} inom{lfloor frac{n}{p} floor}{i} x^{ip}) imes (sumlimits_{i = 0}^{n mod p} inom{n mod p}{i}) x^i equiv (sumlimits_{i = 0}^{lfloor frac{n}{p} floor} inom{lfloor frac{n}{p} floor}{i} x^{ip}) imes (sumlimits_{i = 0}^{p - 1} inom{n mod p}{i}) x^i (mod p))
所以(inom{n}{i} x^i equiv inom{lfloor frac{n}{p} floor}{lfloor frac{i}{p} floor} x^{lfloor frac{i}{p} floor imes p} imes inom{n mod p}{i mod p} x^{i mod p})
证毕