Saturday, July 23, 2016

elementary number theory - Exponent of $p$ in the prime factorization of $n!$



Exponent of $p$ in the prime factorization of $n!$ is given by $\large \sum \limits_{i=1}^{\lfloor\log_p n \rfloor } \left\lfloor \dfrac{n}{p^i}\right\rfloor $.
Can this sum be simplified further to some direct expression so that the number of calculations are reduced?


Answer



yes:




$$
\frac{N-\sigma_p(N)}{p-1}
$$
where $\sigma_p(N)$ is the sum of digits in the $p$-ary expression of $N$


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...