# Prove or name this identity: the number of factors of $p$ in $\binom{n}{k}$ is $(s_p(k)+s_p(n-k)-s_p(n))/(p-1)$

you can count the number of factors of $p$ that are in $\binom{n}{k}$ for prime $p$. Let $s_p(n)$ be the sum of the digits of $n$ in base $p$. Then, the number of factors of $p$ in $\binom{n}{k}$ is $(s_p(k)+s_p(n-k)-s_p(n))/(p-1)$.

-
I have heard this result attributed to Kronecker. You can prove it by computing the power of $p$ dividing a factorial. – Qiaochu Yuan Feb 20 '12 at 20:17

It's a corollary of Legendre's 1808 theorem that power of the prime $p$ that divides $n!$ is
$$[n/p] + [n/p^2] + [n/p^3] +\: \cdots\ =\ \frac{n-s_p(n)}{p-1}$$