I have two questions on the topic, the
first relates to finding the number of powers of a
prime number p in n! and the
second relates to finding the number of powers of a
non-prime in n!.
1) According to the GMAT Club Math book, the formula is:
n/p + n/(p^2) + n/(p^3).. until (p^x)<n
However, this doesn't seem to work for the powers of 2 in 4! ?
We know that 4! = 4*3*2*1 = (2*2)*3*2*1 = (2^3)*3, so the answer we get via the above formula should be 3. However, if we go ahead and do this:
n/p = 4/2 = 2? If I take it one term further 4/(2^2) then we get 4/2 + 4/(2^2) = 2+1=3, which is indeed the right answer but this extra term violates the condition (p^x)<n ? The only thing I can think of is that p^x should be less than
or equal to n and not just less than?
---
2) The second question I have is regarding this (also from the GMAT Math Book)

I understand everything here apart from the last sentence. Can someone explain?