11 Aug, 2010
Find the number of zero's in 'Factorial of a number' N factorial
For n as the number,
round(n/5) + round(n/25) + round(n/125)+.......+round(n/5^n)
etc till the reminder is 0.
Explain how?
A zero is formed when a 5 and 2 get multiplied, therefore finding the number of 5's would be enough to find the number of 10's since 5's would be less in number than 2.
Lets take an example
30! = 1 x 2 .. x 5 x... x 10 .. x 15 ..x. 25 ... 30
It has 7 fives. Number of 5's can be found out by plainly dividing the number by 5 which gives you 6, But there is an extra 5 in the 25 since 25 = 5*5, which can be got again by dividing the number 5. So continuing so on, we get the above formulae..
You may also like
Email Newsletter
Popular Posts
Recent Posts
Tags
Random photo
Beach is this way in
Havelock Island Andaman
On Facebook
Recent Comments
- Can you try checking with a different cable ...
1 month, 4 weeks ago
- wow that's hilarious
1 month, 4 weeks ago
- Perfect! Thanks! :D
1 month, 4 weeks ago
- Having the same issue. Were you able to ...
2 months ago
- hi im having problem with the hdmi port.. ...
2 months, 1 week ago
- Hi, As of today the way2sms website has ...
3 months, 2 weeks ago
- HI! I have a problem with my lg ...
6 months, 3 weeks ago
- You know what would be a GREAT idea ...
6 months, 3 weeks ago
- Hi, For changing MAC address in win7 just ...
6 months, 3 weeks ago
- anybody who might read this now should be ...
7 months ago
- For me the eror was consistenr until I ...
9 months, 2 weeks ago
- Hi I have a problem with my samsung ...
10 months ago
- Ya that was helpful but i am not ...
10 months, 2 weeks ago
- I meant </script> tag.
10 months, 3 weeks ago
- Hi digitalpbk, Thanks for your response. I think ...
10 months, 3 weeks ago
True - except...
This is only true for "trailing" zeroes.
13! = 6227020800 = 4 zeroes.
But 14! = 87178291200 = 2 zeroes.
I think your formula breaks down...