I was born in year 1996. Find the number of trailing zeroes in 1 9 9 6 ! .
Clarification:
It is
1
9
9
6
factorial. That is
1
9
9
6
×
1
9
9
5
×
1
9
9
4
×
…
×
2
×
1
.
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.
hi. i wrote 10 in place of 5 so that i got 219 10,s in the factorial. then i thought that 219 zeroes in the end of the factorial's value. why isn't my method correct? please help me out here.
Log in to reply
10 will "miss" half of the 5s, namely all of the 5s multiplied by odds (like 15, 35, 45). Let me take it back a step, the zeros are 10s, but the prime factorization of 10 is 2*5. You quickly find that this problem, when factored by primes, has an over abundance of 2s, and that the number of 5s dictates the logic. The first sweep of dividing 1996 by 5 yields 399 5s. But then one needs to take into account the numbers in 1996! that have 5^2 in their factorizations, and then 5^3, etc.
To answer your question, 10 misses a bunch of 5s.
1996/5 = 399
399/5=79
79/5=15
15/3=3
399+79+15+3 = 496
Why 5 is divided
Log in to reply
Because you need to count how many times 1996! is multiplied to 10 or in other words count the number of (5x2) in 1996!. Since 2 is used more than 5 in 1996!, just count 5. :)
For this ans, I think that the last step should've been 15/5 = 3 and not 15/3 = 3.
why 4 terms only?
Log in to reply
In this process, you are dividing each time by 5 and finding the closest integer value without going over. You could theoretically keep going, but then your fifth term would be 3/5=0 and all subsequent terms would be 0/5=0, so after the fourth term you would be adding 0 to your total infinitely many times. Adding 0 would have no effect on your answer.
I would never manage to get a correct answer to this by hand. In Python:
>>> N=1996
>>> zeroes=0
>>> for i in range(1, int(log(N,5))+1):
... zeroes+=int(1. N/5 *i)
...
>>> zeroes
496
Plz xpln more.Looks lyk a good alternative soln.
5^1 = 1996 ÷ 5 = 399.2
5^2 = 1996 ÷ 25 = 79.84
5^3 = 1996 ÷ 125 = 15.968
5^4 = 1996 ÷ 625 = 3.1936
5^5 = 1996 ÷ 3125 = 0.63872
399 + 79 + 15 + 3 = 496
I got it too!
Divide the number by 5. Divide it by 25. Divide it by 125. Divide it by 625.
As long as the answer n < 5, you do not stop dividing the number by 5^x. x is the exponent.
Just get the whole numbers from the quotients and never mind the fractions.
Why is this becoming over-rated? HAHAHA.
Wait, Is your name really Precious Prestosa?
Log in to reply
Yes, HAHAHA.
Log in to reply
Wow! That's (Precious) a nice first name :P
Log in to reply
@Krishna Ar – HAHA. Thank you ;)
Log in to reply
@Astro Enthusiast – This is a nice solution Precious ;)
@Astro Enthusiast – How did you change your name?
Problem Loading...
Note Loading...
Set Loading...
Legendre's theorem. [ 5 1 9 9 6 ] + [ 2 5 1 9 9 6 ] + [ 1 2 5 1 9 9 6 ] + [ 6 2 5 1 9 9 6 ] + ... = 4 9 6 Here, [ x ] represents the greatest integer less than or equal to the real number x .