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

• Nov 14th 2008, 10:34 PM
chandni
on findin nos of 0's at end of a factorial
find 0's at end of 1*2^2 *3^3 *......100^100??
• Nov 15th 2008, 03:29 AM
PaulRS
Let $
v_p \left( n \right)
$
be the maximum $
s \in \mathbb{N}
$
such that $
\left. {p^s } \right|\left( {1^1 \cdot 2^2 \cdot ... \cdot n^n } \right)
$

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

For example for $n=25$ we have $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 $
\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 $a^a$ is itself $a$ multiplied by the maximum $s$ such that $5^s|a$

Now since $
\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 $s$ such that $5^s|j$ is $
{\sum\limits_{k = 1}^\infty {\left\lfloor {\tfrac{j}
{{5^k }}} \right\rfloor - \left\lfloor {\tfrac{{j - 1}}
{{5^k }}} \right\rfloor } }
$

Thus: $
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: $
\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 $a$ appears in as many sums as the maximum $s$ such that $5^s|a$)

PS- That's not a factorial
• Nov 15th 2008, 09:11 AM
Soroban
Hello, chandni!

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

Quote:

Find the number of 0's at the end of: . $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: . $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).
$\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 $1050$
. . Hence, the product contains a factor of $5^{1050}$ . . . . no

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

. . ${\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: . ${\color{blue}25 + 50 + 75 + 100 \:=\:250}$ fives.

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

Therefore, the product ends in 1300 zeros.

Thank you, Opalg!
.
• Nov 16th 2008, 07:20 PM
chandni
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