Find the trailing number of zeros upon the expansion of 1 2 3 4 5 6 7 8 9 ! .
Bonus : Can you generalize this?
Notation : ! denotes the factorial notation. For example, 8 ! = 1 × 2 × 3 × ⋯ × 8 .
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.
@Armain Labeeb , it is not a good idea to set a problem with so heavy computation. You can set a Computer Science problem for that. The idea is for others to learn about theory instead of how to use a calculator. Not many will have the patience to do the computation and try your problem. And many may fail to answer the problem not because they don't know how to solve it but because of making mistakes in punching their calculator. I used Wolfram Alpha to check the answer.
Log in to reply
My bad. I will do smaller numbers next time. And by the way, I have not learnt about summation yet, sir so I will post another solution by not using summations.
A number gets a zero at the end of it if the number has 1 0 as a factor. For instance, 1 0 is a factor of 5 0 , 1 2 0 , and 1 2 3 4 5 6 7 8 9 0 etc.. So I need to find out how many times 1 0 is a factor in the expansion of 1 2 3 4 5 6 7 8 9 ! .
But since 5 × 2 = 1 0 , All the products of 5 and 2 needs to be taken account of. Looking at the factors in the expansion, there are many more numbers that are multiples of 2 ,i.e., ( 2 , 4 , 6 , 8 , 1 0 , 1 2 , 1 4 , … ) than are multiples of 5 ,i.e., ( 5 , 1 0 , 1 5 , … ) . That is, if all the numbers with 5 as a factor is taken, there will be way more than enough even numbers (multiples of 2 ) to pair with them to get factors of 1 0 (and another trailing zero on the factorial). So to find the number of times 1 0 is a factor, all I really need to worry about is how many times 5 is a factor in all of the numbers between 1 and 1 2 3 4 5 6 7 8 9 .
The largest multiple less than 1 2 3 4 5 6 7 8 9 is 1 2 3 4 5 6 7 8 5 . So the number of multiples of 5 between 1 and 1 2 3 4 5 6 7 8 9 is 1 2 3 4 5 6 7 8 5 ÷ 5 = 2 4 6 9 1 3 5 1 .
But, 2 5 = 5 × 5 , so each multiple of 2 5 has an extra factor of 5 , which also needs to be taken account of. 1 2 3 4 5 6 7 8 9 ÷ 2 5 = 4 9 3 8 2 7 1 . 5 6 . So there are 4 9 3 8 2 7 1 factors of 2 5 between 1 and 1 2 3 4 5 6 7 8 9 .
In this way, we arrive at a general rule:
Using the above procedure , we have:
1 2 3 4 5 6 7 8 9 ÷ 5 1 1 2 3 4 5 6 7 8 9 ÷ 5 2 1 2 3 4 5 6 7 8 9 ÷ 5 3 1 2 3 4 5 6 7 8 9 ÷ 5 4 1 2 3 4 5 6 7 8 9 ÷ 5 5 1 2 3 4 5 6 7 8 9 ÷ 5 6 1 2 3 4 5 6 7 8 9 ÷ 5 7 1 2 3 4 5 6 7 8 9 ÷ 5 7 1 2 3 4 5 6 7 8 9 ÷ 5 8 1 2 3 4 5 6 7 8 9 ÷ 5 9 1 2 3 4 5 6 7 8 9 ÷ 5 1 0 = 2 4 6 9 1 3 5 7 . 8 = 4 9 3 8 2 7 1 . 5 6 = 9 8 7 6 5 4 . 3 1 2 = 1 9 7 5 3 0 . 8 6 2 4 = 3 9 5 0 6 . 1 7 2 4 8 = 7 9 0 1 . 2 3 4 4 9 6 = 1 5 8 0 . 2 6 4 8 9 9 = 3 1 6 . 0 4 9 3 7 9 8 = 6 3 . 2 0 9 8 7 5 9 7 = 1 2 . 6 4 1 9 7 5 1 9 = 2 . 5 2 8 3 9 5 0 3 9
The number of trailing zeros is the sum of the the above divisions after their answer is truncated .
So if k is the number of trailing zeroes,
k = 2 4 6 9 1 3 5 7 + 4 9 3 8 2 7 1 + 9 8 7 6 5 4 + 1 9 7 5 3 0 + 3 9 5 0 6 + 7 9 0 1 + 1 5 8 0 + 3 1 6 + 6 3 + 1 2 + 2 = 3 0 8 6 4 1 9 2
Problem Loading...
Note Loading...
Set Loading...
The number of trailing zeros z ( n ) of n ! is given by:
z ( n ) ⟹ z ( 1 2 3 4 5 6 7 8 9 ) = k = 1 ∑ ∞ ⌊ 5 k n ⌋ = k = 1 ∑ ∞ ⌊ 5 k 1 2 3 4 5 6 7 8 9 ⌋ = ⌊ 5 1 2 3 4 5 6 7 8 9 ⌋ + ⌊ 5 2 1 2 3 4 5 6 7 8 9 ⌋ ⌊ 5 3 1 2 3 4 5 6 7 8 9 ⌋ + . . . + ⌊ 5 1 1 1 2 3 4 5 6 7 8 9 ⌋ = 2 4 6 9 1 3 5 7 + 4 9 3 8 2 7 1 + 9 8 7 6 5 4 + 1 9 7 5 3 0 + 3 9 5 0 6 + 7 9 0 1 + 1 5 8 0 + 3 1 6 + 6 3 + 1 2 + 2 = 3 0 8 6 4 1 9 2 Note that for k ≥ 1 2 , ⌊ 5 k 1 2 3 4 5 6 7 8 9 ⌋ = 0 .