formula for highest power of prime smaller than N

55 Views Asked by At

Let $e_p$ be the highest power of prime $p \leq n$. I have often come across this formula $$e_p = \Big\lfloor \frac{\log n}{\log p} \Big\rfloor$$, but I cannot understand how this formula holds. I don't know whether this will be useful, but I only can see that it can be expressed as a sum $e_p = \sum_{p^\alpha \leq n} 1$. How can I derive the formula that $e_p = \Big \lfloor \frac{\log n}{\log p} \Big \rfloor$?

1

There are 1 best solutions below

0
On

Let $n,p\in \mathbb N$ be given with $p$ prime and define $k$ by $p^k\leq n<p^{k+1}$ (and your $e_p$ is this $k$). Then $$\log (p^k)\leq \log n\iff k\leq \frac {\log n}{\log p}\iff k\leq \lfloor \frac {\log n}{\log p}\rfloor $$