Number of zeros in a factorial of a number

This topic has expert replies
Master | Next Rank: 500 Posts
Posts: 416
Joined: Wed Oct 03, 2007 9:08 am
Thanked: 10 times
Followed by:1 members

Number of zeros in a factorial of a number

by gmatrant » Tue Oct 16, 2007 7:59 pm
If P = (n)(n – 1)(n – 2) . . . (1) and n > 2, what
is the largest value of integer n where P has zero
as its last 6 digits and a non-zero digit for its
millions place?
(A) 29
(B) 30
(C) 34
(D) 35
(E) 39

The answer is B. But I chose A, and my approach was as follows. Please let me know what is wrong.

29!
I get multiples of 5*2 - 1 zero
10 - 1 zero
15*4 - 1 zero
20 - 1 zero
25*8 - 2 zeros
---------------------------
6 zeros
So it has to be 29!.
Please let me know if this is right.

Thanks
Source: — Problem Solving |

User avatar
Legendary Member
Posts: 986
Joined: Wed Dec 20, 2006 11:07 am
Location: India
Thanked: 51 times
Followed by:1 members

by gabriel » Wed Oct 17, 2007 2:15 am
Well 29! sounds right to me .. 30 would definitely add a additional 0

Master | Next Rank: 500 Posts
Posts: 175
Joined: Mon Jul 02, 2007 12:01 pm
Thanked: 15 times
Followed by:1 members

by jangojess » Wed Oct 17, 2007 5:11 am
when u take 25! itself there will be 6 zeros at the end.....this can be calculated in a diff way...

number of 5s in 25 = 5
number of 25s in 25 = 1
so total number of zeros = 6...
Trying hard!!!

Master | Next Rank: 500 Posts
Posts: 416
Joined: Wed Oct 03, 2007 9:08 am
Thanked: 10 times
Followed by:1 members

by gmatrant » Wed Oct 17, 2007 7:04 am
jangojess wrote:when u take 25! itself there will be 6 zeros at the end.....this can be calculated in a diff way...

number of 5s in 25 = 5
number of 25s in 25 = 1
so total number of zeros = 6...
Sorry, Didnt get ya...
Can you explain this further . Also what is your final answer?

Master | Next Rank: 500 Posts
Posts: 416
Joined: Wed Oct 03, 2007 9:08 am
Thanked: 10 times
Followed by:1 members

by gmatrant » Thu Oct 18, 2007 5:33 am
jangojess wrote:when u take 25! itself there will be 6 zeros at the end.....this can be calculated in a diff way...

number of 5s in 25 = 5
number of 25s in 25 = 1
so total number of zeros = 6...
I agree with you jangojess... 25! would as such suffice as an answer, but from the choices isnt 29! the appropriate

User avatar
Legendary Member
Posts: 986
Joined: Wed Dec 20, 2006 11:07 am
Location: India
Thanked: 51 times
Followed by:1 members

by gabriel » Thu Oct 18, 2007 5:55 am
Read the question properly, it asks for the maximum value of "n" , 25 is not the maximum value "n" can take but 29 is ...

Regards

Junior | Next Rank: 30 Posts
Posts: 24
Joined: Tue Sep 18, 2007 6:27 pm

by dingo001 » Thu Oct 18, 2007 11:03 am
Can someone explain this one in some detail?

Master | Next Rank: 500 Posts
Posts: 416
Joined: Wed Oct 03, 2007 9:08 am
Thanked: 10 times
Followed by:1 members

by gmatrant » Fri Oct 19, 2007 9:51 am
dingo001 wrote:Can someone explain this one in some detail?
So is the OA wrong. It has to be 29!

User avatar
Legendary Member
Posts: 986
Joined: Wed Dec 20, 2006 11:07 am
Location: India
Thanked: 51 times
Followed by:1 members

by gabriel » Fri Oct 19, 2007 12:16 pm
Yup.. the OA is wrong .. the answer should be 29! ...

Master | Next Rank: 500 Posts
Posts: 460
Joined: Sun Mar 25, 2007 7:42 am
Thanked: 27 times

by samirpandeyit62 » Fri Oct 19, 2007 10:08 pm
Agree with Gabriel the ans should be 29!

coz 29 has 6 pairs of 5,2 which would lead to 6 trailing zero's.
Regards
Samir

Master | Next Rank: 500 Posts
Posts: 258
Joined: Mon Aug 27, 2007 12:43 pm
Thanked: 15 times

by ri2007 » Mon Oct 29, 2007 12:49 pm
could some one pls explain this one to me again.

29! = 8.84176199 × 10^30 ... as per google calculator

which is also 884176199 × 10^22,

this numbser does not satisfy the question asked.

Could you pls help me clarify my basic understanding of a question such as this?

Thanks so much

Master | Next Rank: 500 Posts
Posts: 315
Joined: Thu Aug 17, 2006 10:43 pm
Thanked: 23 times

by Suyog » Mon Oct 29, 2007 5:23 pm
i think 30 will have 6 pairs of 5,2 and not 29.....

Master | Next Rank: 500 Posts
Posts: 416
Joined: Wed Oct 03, 2007 9:08 am
Thanked: 10 times
Followed by:1 members

by gmatrant » Tue Oct 30, 2007 6:52 am
Suyog wrote:i think 30 will have 6 pairs of 5,2 and not 29.....
No 30 has 7 fives and will have surely have 7 twos... so total zeroes is 7 not six..it cant be 30... please comment

Master | Next Rank: 500 Posts
Posts: 315
Joined: Thu Aug 17, 2006 10:43 pm
Thanked: 23 times

by Suyog » Tue Oct 30, 2007 7:23 am
i think i'm missing something....how 7?

Master | Next Rank: 500 Posts
Posts: 258
Joined: Mon Aug 27, 2007 12:43 pm
Thanked: 15 times

by ri2007 » Tue Oct 30, 2007 7:30 am
here is a copy of the reply I got from Samir Pandey -

if u try the same on the windows calculator in scientific mode u will get the answer.

the approach here is very simple, 29! will be a nos

now the nos of 0's in 29! will depend upon the nos of pairs of 5,2 in 29! i.e 5*2 =10 which produces a 0

so to count the nos of pairs of 5,2 in 29! we just need to count the nos of 5 's (this is universal) coz nos of 5's will be more than 2's

the best way to count it is bu divinding 29 or any n by 5 & taking the qoutient, 5^2 & taking the quotinet only .....so on with higher powers of 5 till we get a non zero quotient

using this appraoach we can say

29/5 = 5 (quotient)

29/25 = 1

other powers will give 0 qoutient

so nos of 5's in 29! is 5+1 hence 0's =6

for 30! we have

30/5 =6
30/25 =1

so 7 zeroes

Thanks again Samir