Given that x ! has 2016 trailing zeros , find the minimum value of x .
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.
I didnt get the 2 line
Log in to reply
It seems, he is approximating it to an infinite geometric progression, neglecting the floor function. That would be an approximate number lesser than the correct answer for some sufficiently large n.
The answer which is inch perfect would be 8340. check it out
Log in to reply
The factorial of 8340 has 2082 zeroes.
Log in to reply
e= [8340/5] + [8340/25] + [8340/625] + [8340/3125] + ..... = 1668 + 333 + 13 + 2 + 0 = 2016
Log in to reply
@Aditya Narayan Sharma – You are missing ⌊ 1 2 5 8 3 4 0 ⌋ = 6 6
Log in to reply
@Akshat Sharda – Thanks. My mistake. :) these silly mistakes are my nightmares
Implementation Trailing Number of Zeros , I use C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
No. of trailing zeroes for any number say n is [ 5 n ] + [ 2 5 n ] + [ 1 2 5 n ] + . . . where [ . ] is greatest integer function for n € N using this I got minimum value of n equal to 8 0 7 5
Problem Loading...
Note Loading...
Set Loading...
Using Trailing Number of Zeros , we want
2 0 1 6 = ⌊ 5 n ⌋ + ⌊ 5 2 n ⌋ + ⌊ 5 3 n ⌋ + …
Using an approximation from Geometric Progression Sum ,
2 0 1 6 = 1 − 5 1 5 n
2 0 1 6 = 4 n ⇒ n = 8 0 6 4
Number of zeroes in 8 0 6 4 ! = 2 0 1 2 .
Therefore to get four more zeroes (i.e. 2 0 1 6 zeroes) the answer must be 8 0 7 5 .
Quicker Approximation
x = 4 n where x ! has n zeroes.