"Wiki of the Day" - Trailing zeroes question

Find the trailing number of zeros in 2021 ! 2021! in base 21 (here 2021 is represented in base 10).


The answer is 334.

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.

1 solution

Saya Suka
Mar 25, 2021

21 = 7 × 3
Since 7 is the bigger prime factor, it will have to be used in the calculations of trailing zeros.

Number of trailing zeros in (2021!)_21
= floor[ 2021 / 7¹ ] + floor[ 2021 / 7² ] + floor[ 2021 / 7³ ]
= 288 + 41 + 5
= 334

another way (I can't do a explanation I get wrong):

import math

1.num = math.factorial(2021) 2.count = 0 3.while num % 21 == 0: 4.num //= 21 5.count += 1 6.print(count)

Elijah Frank - 2 months, 2 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...