Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.