Legendre公式
对于质数(p),函数(v_p(n))为(n)标准分解后(p)的次数
显然有
[v_p(n!) = sumlimits_{i = 1}^{infty} lfloor frac{n}{p^i}
floor
]
令函数(s_p(n))为(n)在(p)进制下的数位和
有:
[v_p(n!) = frac{n - s_p(n)}{p - 1}
]
证明:
设(n = sumlimits_{i = 0}^{infty} c_i p^i),
有(v_p(n!) = sumlimits_{i = 1}^{infty} lfloor frac{n}{p^i} floor)
(= sumlimits_{i = 1}^{infty} sumlimits_{j = i}^{infty} c_j p^{j - i})
(= sumlimits_{j = 1}^{infty} c_j sumlimits_{i = 0}^{j - 1} p^i)
(= sumlimits_{j = 1}^{infty} frac{c_j(p^j - 1)}{p - 1})
(= frac{1}{p - 1} (sumlimits_{i = 0}^{infty} c_i p^i - sumlimits_{i = 0}^{infty} c_i))
$= frac{n - s_p(n)}{p - 1} $
Kummer定理
二项式系数
[v_p(inom{n}{m}) = frac{s_p(m) + s_p(n - m) - s_p(n)}{p - 1}
]
同时也等于在(p)进制下运算(n - m)时退位的次数
多项式系数
(inom{n}{m_1, cdots, m_k} = frac{n!}{m_1! cdots m_k!})
[v_p(inom{n}{m_1, cdots, m_k}) = frac{sumlimits_{i = 1}^k s_p(m_i) - s_p(n)}{p - 1}
]