[N] Question 4: number theory

Find the number of 0s at the end of

1 ! × 2 ! × 3 ! × . . . × 30 ! 1!\times 2!\times 3!\times ...\times 30!


The answer is 87.

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

Julian Poon
Sep 17, 2014

So the number of trailing 0 0 s depends on the number of pairs of 2 × 5 2\times5 . Since there are more 2 2 s than 5 5 s, we are only concerned in finding the number of 5 5 s.

So,

1 ! t o 4 ! 1! \quad to\quad4! --- n o 5 s no \quad5s

5 ! t o 9 ! 5! \quad to\quad9! --- o n e 5 s one\quad 5s

10 ! t o 14 ! 10! \quad to\quad14! --- t w o 5 s two \quad5s

...

20 ! t o 24 ! 20! \quad to\quad24! --- f o u r 5 s four \quad5s

25 ! t o 29 ! 25! \quad to\quad29! --- SIX 5 s {\textbf{SIX}} \quad5s

30 ! 30! --- SEVEN 5 s {\textbf{SEVEN}}\quad 5s

Note that beyond 25 ! 25! , it's pattern change cause 25 = 5 2 25={ 5 }^{ 2 }

So the total number of 5 5 s is 5 × ( 1 + 2 + 3 + 4 + 6 ) + 7 = 87 5\times(1+2+3+4+6)+7=\boxed{87}

1
2
3
4
5
6
temp = 0
for i in range(1,31):
    num = i/5 + i/25
    temp += num

print temp

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...