highest power of Prime How to find the highest power of prime $p$ in $N!$, when
.$p^r-1<N<p^r+p$
$p^r-p<N<p^r$
I know  that the highest power of prime contained in $N!$ is given by:
$$s_p(N!) = \left \lfloor \frac{N}{p} \right \rfloor + \left \lfloor \frac{N}{p^2} \right \rfloor + \left \lfloor \frac{N}{p^3} \right \rfloor + \cdots$$
But how to apply the restrictions?
 A: The formula is true for all $N \geq 0$; the restriction does not affect its truth value.  However, we can simplify things.

*

*We see that $s_p(N!)=s_p((N-(N \text{ mod } p))!)$.  Since the factors $N-(N \text{ mod } p)+1,N-(N \text{ mod } p)+2,\ldots,N$ make no contribution to $s_p(N!)$, as they are coprime to $p$.  [Here $N \text{ mod } p$ represents the residue in $\{0,1,\ldots,n-1\}$.]
E.g. in the first case, this means $s_p(N!)=s_p(p^r!)$.


*We can "chop off" terms $\lfloor N/p^k \rfloor$ for which $N/p^k<1$, since the floor function will make them zero.
So, when applying the formula to $p^r!$, we need only account for the terms $\lfloor p^r/p^k \rfloor$ where $1 \leq k \leq r$.  Further, in this case, $p^k$ divides $p^r$, so the floor functions are unnecessary.
A: $p$ is a prime number, therefore it cannot be decomposed, and it appears as a whole in each parenthesis:
$$n\cdot(n-1)\cdot(n-2)...(kp+1)\cdot kp\cdot(kp-1)...\cdot\;3\;\cdot\;2\;\cdot\;1$$
We are calculating the exponents:
If $\Bigg\lfloor\frac{n}{p}\Bigg\rfloor=k\ne 0,$ it means there are $k$ $x$-es $\rightarrow$integer multiples of $p$, such that $x\leq n,\;k,x\in \mathbb N$ 
If $\Bigg\lfloor\frac{n}{p^2}\Bigg\rfloor=l\ne 0$, it means there are $l$ $y$-s$\rightarrow$ integer multiples of $p^2,$ such that $y\leq n, \;l,y\in \mathbb N$
I hope it's correct.
Some of $y$-s might have been included among $x$-es, but the coefficients in front of $p$ in those terms (when we decompose the composite numbers) are equal to $p$.
The algorithm continues until:$$\Bigg\lfloor\frac{n}{p^i}\Bigg\rfloor=0.$$
In general:$$\forall u,v \in [ap^m, (a+1)p^m-1\rangle: \Bigg\lfloor\frac{u}{p^m}\Bigg\rfloor=\Bigg\lfloor\frac{v}{p^m}\Bigg\rfloor$$
