supritajoshi wrote:Can you please explain what will be answer if we are asked "find out how many 20 are there in 30!" ? I mean in this case also we have to calculate number of 5s in 30 ! . Thanks.
Dude!
Here is the simple logic for finding all the numbers:-
Let's say number to find = N
Then factorize the number N with all possible prime number. Let's say n1, n2, n2.... nn are the prime factors of number N.
Now find the possible number of combination of these prime factors in the given factorial number.
The number will be our answer.
Shortcut: Choose the prime factors whose chances is least to appear in that factorial.
For example:
Let's say N = 20
On factorizing 20, we get 2 x 2 x 5 or 4 x 5.
So, now in 30! we need to find the possible combination of 4 x 5.
Now 4 is the factor of following numbers in 30! :
4, 8, 12, 16, 20, 24, 28 (Total 7)
And 5 is the factor of following numbers in 30! :
5, 10, 15, 20, 25 (5*5), 30 (Total 7)
So possible number of combination = 7
Hence, there SEVEN 20s in 30!