So many 2015

2015! is multiplied by itself 2015 times as follows:

2015 ! × 2015 ! × × 2015 ! 2015 . \underbrace { 2015!\times 2015!\times\cdots\times 2015! }_{ 2015 }.

Count how many trailing zeros there are!


The answer is 1011530.

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.

3 solutions

Freddie Kalaitzis
Apr 17, 2015

In any prime factorization, only a product of 2 and 5 generates a trailing zero, so we need to count the "2*5" pairs in the prime factorization of this number.

To make things easier, only the "5" factors need counting as "5" appears less frequently than the "2" factors. Take 2015! for starters:

2015/5 = 403. This is how many numbers in the product 2015! contain the prime factor 5 at least once.

floor(2015/(5^2)) = 80. This is how many numbers in the product 2015! contain the prime factor 5 at least twice.

floor(2015/(5^3)) = 16. This is how many numbers in the product 2015! contain the prime factor 5 at least thrice.

floor(2015/(5^4)) = 3. This is how many numbers in the product 2015! contain the prime factor 5 exactly four times . We need no more.

403+80+16+3=502 is the number of times "5" appears in the prime factorization of 2015! (no exclamation intended)

So the answer is 2015*502 = 1011530 trailing zeros.

Nice Solution

Hrishik Mukherjee - 6 years, 1 month ago

Check problem statement again.

Catalin Frona - 1 year ago

I didnt get why you multiplied by 2015 in the end

Mr Yovan - 5 years, 7 months ago

Log in to reply

He got the number of trailing zero's in 2015! only, but we have 2015! 2015 times, hence we multiply by 2015.

Sravanth C. - 5 years, 5 months ago

Log in to reply

oh thanks,now i got it

Mr Yovan - 5 years, 5 months ago
Otto Bretscher
Apr 29, 2015

If we write n = 2015 n=2015 to base 5, we end up with 31030; the sum of the digits is s = 7 s=7 . According to Legendre's Theorem, the factor p = 5 p=5 appears n s p 1 = 502 \frac{n-s}{p-1}=502 times in 2015 ! 2015! . Thus 5 appears 502 × 2015 = 1011530 502\times2015=1011530 times in ( 2015 ! ) 2015 (2015!)^{2015} . Since 2 appears more frequently, namely 2015 10 = 2010 2015-10=2010 times in 2015, the number ( 2015 ! ) 2015 (2015!)^{2015} will have 1011530 \boxed{1011530} trailing zeros.

Subal Chatterjee
Sep 26, 2017

C++ implementation of the formula : [https://ideone.com/rcGY1E) We go with 1 test case and enter 2015 as we are querying for 2015! Now the algorithm will give 502 as output which is the number of trailing zeroes in 2015! . There are total 2015 occurrences of (2015!) because the original query is 2015 * (2015!). Each 2015! gives 502 trailing zeros,hence 2015 such occurrence will give a total of 2015 * 502 trailing zeroes!

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...