TCS
Company
N! have 37 zeroes at its end. How many values of N are possible?
Read Solution (Total 6)
-
- 0 can come in the end only of no. ends with 0 or 2 no.s ending with 2 and 5..which on multiplying give one 0.
So, we have to count no. of 0's,2's and 5's
As a combination of 2 & 5 gives a 0..but there are less no. of 5's as compare to 2's
therefore, we now only want to count no. of 0's and 5's
Special cases-
{ Note-25 and 75 gives 2 5's each
Similarly, 125 gives 3
& 100 gives 2 0's
take care of this..dont forget to count..
}
Now, 1-150 has ~15~ 0's in 10,20,30,...,150
& 1-150 has ~15~ 5's from 5,15,25,35,...,145
Special cases-
~1~ more 0 from 100
~2~ more 5's from 25,75,, ~2~ 5's from 50,150 and ~2~ more 5's from 125
Total = 15+15+1+2+2+2=37
So, N=150 and also 151,152,153,154 coz these 4 following no.s doesn't give any 0 or 5..but 155 does..
THIS CONCEPT IS USED FOR ANY QUESTION OF COUNTING ZEROES IN FACTORIAL, and we use symmetry of special cases..25,125,625..100,1000...to calculate faster :) - 11 years agoHelpfull: Yes(11) No(0)
- 150,151,153,154 will be the answer
- 11 years agoHelpfull: Yes(4) No(1)
- sry all..this previous answer of mine is incorrect
Poulomi roy is right..
adding to my answer that 150,151,152,153,154 will give 37 0's
so total no.s are 5
therefore N=5 is the answer
Note: any question of this type always has answer=5 as after every 5 no.s, no. of 5 increases and hence no. of zeroes by 1 if no. is small 2 if large and so on...
my previous solution is used to calculate no. of zeroes dat is xactly reverse of question above
ALSO ITS A TIME CONSUMING METHOD
So, iff question comes as "find no. of zeros" then use trick mentioned below..
N/(5^1)+N/(5^2)+N/(5^3)+..
divide and ignore remaider whatever comes
Example- find no. of zeroes in 1040! ???
Solution- 1040/5+1040/25+1040/125+1040+625 next power of 5 > 1040 so leave it here
1040/5+1040/25+1040/125+1040+625 = 208+41+8+1 = 258
I just read this trick from wikipedia
http://en.wikipedia.org/wiki/Trailing_zero - 11 years agoHelpfull: Yes(2) No(0)
- @Palash: what is its asked how many 12's are there in 100!? we were asked a qn like that in our placement program! can u plz help
- 11 years agoHelpfull: Yes(1) No(0)
- Hey poulomi,can yu please explain it in detail??
- 11 years agoHelpfull: Yes(0) No(0)
- Thankyou Palash! Understud it very clearly!
- 11 years agoHelpfull: Yes(0) No(0)
TCS Other Question