# Thread: on findin nos of 0's at end of a factorial

1. ## on findin nos of 0's at end of a factorial

find 0's at end of 1*2^2 *3^3 *......100^100??

2. Let $\displaystyle v_p \left( n \right)$ be the maximum $\displaystyle s \in \mathbb{N}$ such that $\displaystyle \left. {p^s } \right|\left( {1^1 \cdot 2^2 \cdot ... \cdot n^n } \right)$

First note that $\displaystyle v_5 \left( n \right) \leqslant v_2 \left( n \right)$ so the number of 0s at the end of $\displaystyle ^1 \cdot 2^2 \cdot ... \cdot n^n$ will be exactly $\displaystyle v_5 \left( n \right)$

For example for $\displaystyle n=25$ we have $\displaystyle v_5 \left( n \right)=5+10+15+20+2\cdot{25}$, note that the coefficients of the multiples of 5 are the maximum powers of 5 dividing these numbers. This comes from $\displaystyle \left( {5^a \cdot k} \right)^{5^a \cdot k} = 5^{\boxed{a \cdot 5^a \cdot k}} \cdot k^{a \cdot 5^a \cdot k}$ - (k,5)=1- So the maximum power of 5 dividing the number $\displaystyle a^a$ is itself $\displaystyle a$ multiplied by the maximum $\displaystyle s$ such that $\displaystyle 5^s|a$

Now since $\displaystyle \left\lfloor {\tfrac{j} {n}} \right\rfloor - \left\lfloor {\tfrac{{j - 1}} {n}} \right\rfloor = \left\{ \begin{gathered} 1{\text{ if }}\left. n \right|j \hfill \\ 0{\text{ otherwise}} \hfill \\ \end{gathered} \right.$ it follows that the maximum $\displaystyle s$ such that $\displaystyle 5^s|j$ is $\displaystyle {\sum\limits_{k = 1}^\infty {\left\lfloor {\tfrac{j} {{5^k }}} \right\rfloor - \left\lfloor {\tfrac{{j - 1}} {{5^k }}} \right\rfloor } }$

Thus: $\displaystyle v_p \left( n \right) = \sum\limits_{j = 1}^n {\left( {\sum\limits_{k = 1}^\infty {\left\lfloor {\tfrac{j} {{5^k }}} \right\rfloor - \left\lfloor {\tfrac{{j - 1}} {{5^k }}} \right\rfloor } } \right) \cdot j}$

It may also be written as: $\displaystyle \sum\limits_{i = 1}^{\left\lfloor {\frac{n} {5}} \right\rfloor } {5 \cdot i} + \sum\limits_{i = 1}^{\left\lfloor {\frac{n} {{25}}} \right\rfloor } {25 \cdot i} + ... + \sum\limits_{i = 1}^{\left\lfloor {\frac{n} {{5^{\left\lfloor {\log _5 \left( n \right)} \right\rfloor } }}} \right\rfloor } {5^{\left\lfloor {\log _5 \left( n \right)} \right\rfloor } \cdot i}$ ( note that $\displaystyle a$ appears in as many sums as the maximum $\displaystyle s$ such that $\displaystyle 5^s|a$)

PS- That's not a factorial

3. Hello, chandni!

Opalg pointed out a big error in my calculatitons . . . *blush*

Find the number of 0's at the end of: .$\displaystyle 1^1\cdot2^2\cdot3^3\cdot4^4\cdots100^{100}$

Every factor of 5 (combined with an even number) produces a final zero.

How many 5's are in that product?

Zeros arise from: .$\displaystyle 5^5\cdot 10^{10} \cdot 15^{15} \cdot 20^{20} \cdots 100^{100} \;= \;(5^5)\,(2^{10}5^{10})\,(3^{15}5^{15})\,(4^{20}5^ {20}) \cdots (20^{100}5^{100})$

We are concerned with the factors of 5 (only).
$\displaystyle \text{So we have: }\;5^5\cdot5^{10}\cdot5^{15}\cdot5^{20} \cdots 5^{100} \;=\;5^{\overbrace{(5+10+15+20+\cdots+100)}^{\text {arithmetic series}}}$

The sum of the series is $\displaystyle 1050$
. . Hence, the product contains a factor of $\displaystyle 5^{1050}$ . . . . no

I overlooked these factors: .$\displaystyle {\color{blue}25^{25},\;50^{50},\;75^{75},\;100^{10 0}}$

. . $\displaystyle {\color{blue}\begin{array}{cccccc}25^{25} &=& (5^2)^{25} & =& 5^{50} & \text{50 zeros, not 25} \\ 50^{50} &=& 2^{50}(5^2)^{50} &=& 2^{50}5^{100} & \text{100 zeros, not 50}\\ 75^{75} &=& 3^{75}(5^2)^{75} &=& 3^{75}5^{150} & \text{150 zeros, not 75} \\ 100^{100} &=& 4^{100}(5^2)^{100} &=& 4^{100}5^{200} & \text{200 zeros, not 100}\end{array}}$

My total was short by: .$\displaystyle {\color{blue}25 + 50 + 75 + 100 \:=\:250}$ fives.

The product contains a factor of: .$\displaystyle {\color{blue}5}^{{\color{red}1300}}$

Therefore, the product ends in 1300 zeros.

Thank you, Opalg!
.

4. ## recheck ur solution

hey i got dat but m confused as to y u included 100^100 and 50^50 in ur calculations the 2nd time wen u had already included it previously...jus chk out dat n do reply