# Find the prime factor decomposition of $100!$ and determine how many zeros terminates the representation of that number. [duplicate]

Find the prime factor decomposition of $100!$ and determine how many zeros terminates the representation of that number.

Actually, I know a way to solve this, but even if it is very large and cumbersome, and would like to know if you have an easier way, or if I am applying wrong. Setting by $\left[\frac{b}a \right]$ the quotient of $b$ with $a$, we have too $E_p(m)$ the largest exponent power $p$ dividing $m$, and found the demonstration of a theorem that says (that in my text says it was discovered that Lagendre) $$E_p(n!)=\left[\frac{n}p \right]+\left[\frac{n}{p^2} \right]+\left[\frac{n}{p^3} \right]+\;...$$always remembering that there will be a number $s$ such that $p^s\geq n!$ which tells us that $$\left[\frac{n!}{p^s} \right]=0$$ thus making the sum of a finite $E_p(n!)$. So that I can address the first question I asked, really have to get all the cousins $(p_1,p_2,...,p_k)$ and make all $$E_{p_1},\;E_{p_2},\;E_{p_3},\;...,\;E_{p_k}$$ with $p$ and cousin $1<p<100$. And to find the zeros have to see how we both exponents in numbers 5 and 2.

Example $$10!=2^83^45^27\\p<10\\E_2(10!)=5+2+1=8\\E_3(10!)=3+1=4\\E_5(10!)=2\\E_7(10!)=1\\$$

## marked as duplicate by davidlowryduda♦Oct 19 '17 at 11:51

• Yes, that's the way. Note that you can easily show that $n!$ always has at least as many factors $2$ as factors $5$, so looking at the power of $5$ is enough. – Daniel Fischer Nov 19 '13 at 22:47
• @marcelolpjunior For a full factorisation you'd still need to go the cumbersome way. Only shortcuts if you only care for certain powers (i.e. $5$) – AlexR Nov 19 '13 at 22:53
• Well, not quite. You know that all primes $53,59,\dotsc,89,97$ appear with exponent $1$. $37,41,43,47$ with exponent $2$. $29,31$ with exponent $3$, etc. Only for the primes below $\sqrt{100}$ there's a nontrivial amount of computation to do. – Daniel Fischer Nov 19 '13 at 22:54
• It's not true. Consider $N = 600$. $$\left\lfloor\frac{600}{5} \right\rfloor + \left\lfloor \frac{600}{25}\right\rfloor + \left\lfloor \frac{600}{125}\right\rfloor = 120 + 24 + 4 = 148 = \frac{600}{4} - 2.$$ By @Daniel Fischer... – marcelolpjunior Nov 20 '13 at 15:29