How many zeroes (at the end) will 10! have when written in base 3?

2.6k Views Asked by At

I can get the answer for the question by calculating 10! and then converting it to base 3 but is there a more logical point of view to this question which will mostly generalise the solution for this model.

This question was taken from one of those competitive exams so you will have only less than a minute to solve them.

2

There are 2 best solutions below

6
On BEST ANSWER

The number of zeros is the highest exponent $k$ such that $3^k$ divides $N!$. This is equal to $$\sum_{k=1}^\infty \lfloor N/3^k \rfloor.$$ (Notice that there are only finitely many non-zero terms in this sum.)

Just a short explanation why the formula is as it is: Each multiple of $3$ that is less than or equal to $N$ yields one factor of $3$ to $N!$. Similarly each multiple of $3^2$ yields two factors, but one of these was already accounted when counting the number of multiples of $3$. Etc: Each multiple of $3^k$ yields $k$ factors, $k-1$ of which were already accounted for in the multiples of $3^j$s, $1 \le j \le k-1$.

0
On

Since Base is prime, easiest is prime factorials.
3 is in 3, 6, and twice in 9, makes four zeroes at the end of the number.