A number theory problem by Piyush Kumar

When 30! is computed it ends in 7 zeroes. find the digit that immediately precedes these zeroes.


The answer is 8.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Adarsh Kumar
Sep 14, 2014

F i r s t , p r i m e f a c t o r i s e 30 ! , y o u w i l l g e t : First,prime\ factorise\ 30!,you\ will\ get: 2 26 3 14 5 7 7 4 1 1 2 1 3 2 17 19 23 29 2^{26}*3^{14}*5^{7}*7^{4}*11^{2}*13^{2}*17*19*23*29 W h i c h c a n b e w r i t t e n a s : Which\ can\ be\ written\ as: 2 19 3 14 7 4 1 1 2 1 3 2 17 19 23 29 10000000 2^{19}*3^{14}*7^{4}*11^{2}*13^{2}*17*19*23*29*10000000 W h e n y o u c a l c u l a t e t h e u n i t d i g i t o f : When\ you\ calculate\ the\ unit\ digit\ of: 2 19 3 14 7 4 1 1 2 1 3 2 17 19 23 29 2^{19}*3^{14}*7^{4}*11^{2}*13^{2}*17*19*23*29 Y o u w i l l g e t 8. You\ will\ get\ 8. i t i s 80000000. \Longrightarrow\ it\ is\ 80000000. T h u s , t h e f i r s t n o n z e r o d i g i t i s 8 Thus,the\ first\ nonzero\ digit\ is\ 8

Would you do the same, were it 2014 instead of 30??

Satvik Golechha - 6 years, 8 months ago

Log in to reply

-_- Do you know of an easier waY? If yes, post it

Krishna Ar - 6 years, 8 months ago

Log in to reply

I don't, I was asking Adarsh, if they knew.

Satvik Golechha - 6 years, 8 months ago

Log in to reply

@Satvik Golechha no I wouldn't do it this way if it were 2014 and I don't know any other way.Sorry.

Adarsh Kumar - 6 years, 8 months ago

what i came up with was like this

1x3x4x6x7x8x9 and i got 8 as the last digit (excluding 2 and 5 because they contribute for 0)

when i did 11x13x14x16x17x18x19 then again i got 8 as last digit ;similarly for the twenties. so i concluded 8 as answer.

Afreen Sheikh - 6 years, 4 months ago

Log in to reply

@Afreen Sheikh 8 * 8 * 8 ends with 2, isn't it so?

Vijay Bhaskar - 6 years ago

Log in to reply

@Vijay Bhaskar i agree with u...but i did consider the 22,25,12,15 part as well after that

Afreen Sheikh - 6 years ago

Actually I got a formula to do it ,

N 5 ! × 2 N 5 × ( N m o d 5 ) ! \lfloor \frac{N}{5} \rfloor !×2^{\lfloor \frac{N}{5} \rfloor}×(N\ mod\ 5)!

Where : N N \rightarrow The number ( N ! ) (N!) whose last non-zero digit we have to calculate.

Akshat Sharda - 5 years, 9 months ago
1
2
3
4
5
6
7
prod = 1
for i in range(1,31):
    prod *= i
    while prod%10==0:
        prod /= 10
prod %= 10
print prod

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...