Count the Zer00000000000000000000000s

How many trailing zeros are there in 2020 ! 2020! ?

Notation: ! ! denotes the factorial notation .

Bonus: Comment the sum of all the digits in 2020 ! 2020! .


The answer is 503.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Noe Blassel
Jan 19, 2020

The number of trailing zeros of n ! n! is given by the largest k k such that 1 0 k n 10^k|n . But since 10 = 2 5 10=2\cdot 5 , k = min ( v 2 ( n ) , v 5 ( n ) ) k=\operatorname{min}(v_2(n),v_5(n)) , where for any prime number p, v p ( n ) = max ( k : p k n ) v_p(n)=\operatorname{max}(k: p^k|n) . Furthermore it is clear that v 2 ( n ! ) v 5 ( n ! ) v_2(n!)\geq v_5(n!) for any n n , since many more even numbers contribute than multiples of 5. So the answer we are looking for is v 5 ( 2020 ! ) v_5(2020!) . Using Legendre's formula, we have v p ( n ! ) = n s p ( n ) p 1 v_p(n!)=\frac{n-s_p(n)}{p-1} , where s p ( n ) s_p(n) is the sum of the digits of n n when expressed in base p p . Now write 2020 = 3 5 4 + 5 3 + 4 5 = 3104 0 5 2020=3\cdot 5^4+5^3+4\cdot5=31040_5 , so that s 5 ( 2020 ) = 8 s_5(2020)=8 . Finally, our answer is 2020 8 5 1 = 503 \frac{2020-8}{5-1}=503 .

Chew-Seong Cheong
Jan 19, 2020

The number of trailing zeros of n ! n! is given by z ( n ) = k = 1 n 5 k z(n) = \displaystyle \sum_{k=1}^\infty \left \lfloor \frac n{5^k} \right \rfloor , where \lfloor \cdot \rfloor denotes the floor function . For n = 2020 n=2020 , we have:

z ( 2020 ) = 2020 5 + 2020 25 + 2020 125 + 2020 625 = 404 + 80 + 16 + 3 = 503 \begin{aligned} z(2020) & = \left \lfloor \frac {2020}5 \right \rfloor + \left \lfloor \frac {2020}{25} \right \rfloor + \left \lfloor \frac {2020}{125} \right \rfloor + \left \lfloor \frac {2020}{625} \right \rfloor \\ & = 404 + 80 + 16 + 3 \\ & = \boxed {503} \end{aligned}

Bonus: It is obvious that 2020 ! 2020! is divisible by 9 9 , hence the sum of all the digits of 2020 ! 2020! is also divisible by 9 9 .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...