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..
11 Aug, 2010
Comments (1)
You may also like
Recent Comments
- Siri and Uber also uses Location Services
10 years, 6 months ago
- i connected my dell laptop to videocon lcd …
10 years, 8 months ago
- 05/03/2014_22:09:18,97 C:\Users\kampar>touch .htaccess 'touch' is not recognized as …
10 years, 10 months ago
- IRCTC Tatkal ticket booking script required...
10 years, 11 months ago
- I have a similar solution. I was told …
11 years, 7 months ago
- Can you try checking with a different cable …
11 years, 9 months ago
- wow that's hilarious
11 years, 9 months ago
- Perfect! Thanks! :D
11 years, 9 months ago
- Having the same issue. Were you able to …
11 years, 10 months ago
- hi im having problem with the hdmi port.. …
11 years, 10 months ago
- Hi, As of today the way2sms website has …
11 years, 11 months ago
- HI! I have a problem with my lg …
12 years, 2 months ago
- You know what would be a GREAT idea …
12 years, 2 months ago
- Hi, For changing MAC address in win7 just …
12 years, 2 months ago
- anybody who might read this now should be …
12 years, 2 months 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...