$\sum_{k=1}^{\infty }\left \lfloor \frac{n}{p^k} \right \rfloor=\frac{n-S_n}{p-1}$

73 Views Asked by At

If $p$ is a prime number, $n$ is a natural number, and $S_n$ is the sum of the digits of $n$ when expressed in base $p$.

Prove that $\sum_{k=1}^{\infty }\left \lfloor \frac{n}{p^k} \right \rfloor=\frac{n-S_n}{p-1}$.

Interestingly, any side of the equality can be used to determine the number of factors of $p$ in $n!$.


I have no problem with changing the base from $10$ to $p$, my problem is how to tell if the equality hold true for any prime $p$ and any natural number $n$.

1

There are 1 best solutions below

1
On

Write $$n=\sum_{j=0}^r a_jp^j$$ where the $0\le a_j<p$ are the base $p$-digits. Then $$\left\lfloor\frac n{p^k}\right\rfloor=\sum_{j=k}^r a_jp^{j-k}$$ and then $$\sum_{k=1}^r\left\lfloor\frac n{p^k}\right\rfloor =\sum_{k=1}^r\sum_{j=k}^r a_jp^{j-k} =\sum_{j=0}^ra_j\sum_{k=1}^jp^{j-k}=\sum_{j=0}^ra_j\frac{p^j-1}{p-1}$$ etc.