I'm trying to solve Project Euler's Problem #5 which is:
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to N?
I came across a solution here using prime factorization method. I had difficulty understanding how to calculate the maximum exponent a of a prime P such that $P^a \le N$. I could prove that $P^{\left\lfloor\frac{Log(N)}{Log(P)}\right\rfloor} \le N$, but it doesn't make sure that $a = \left\lfloor\frac{Log(N)}{Log(P)}\right\rfloor$ is the maximum exponent such that $P^a \le N$ and $P^{a + 1} > N$
I need a solid proof/explanation that $a = \left\lfloor\frac{Log(N)}{Log(P)}\right\rfloor$ is in fact, the largest natural number such that $P^a \le N$.
Encouraged by @Gerry Myerson, I could answer my question in a much more straight forward way.
First, we have a prime P and a natural number N, the exponent a' such that $P^a = N$ is obviously $a' = \log_P N$
Second, we also know that $\log_P N = \frac{\log N}{\log P}$, according to logarithm change of base rule. So, $a' = \frac{\log N}{\log P}$
Since a' is a real number, depending whether or not N can be evenly divided by P. So the largest natural number a such that $P^a \le N$, by definition of floor (as mentioned by @Michal Adamaszek), is: $a = \left\lfloor\frac{\log N}{\log P}\right\rfloor$