Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like a hint for the question:

For how many positive integers $k$ does the ordinary decimal representation of the integer $k!$ end in exactly $99$ zeros?


share|cite|improve this question
A 0 at the end of k! comes from multiplying a 2 and a 5. More 2s and 5s, more 0s. – El'endia Starman Sep 13 '11 at 3:25's_formula will be useful. – Srivatsan Sep 13 '11 at 3:25
@Dan Brumleve: Your (deleted) post seems like a rather extended hint rather than a full answer, so I don't see the need to delete. – André Nicolas Sep 13 '11 at 4:58
Related questions include 18261 and 17916. – Gerry Myerson Sep 13 '11 at 5:04
Non necessary to solve the question, but with the other hints, once you have solved this specific example, you might also be able to explore which numbers of zeros are impossible for factorials [when would you add more than one?] – Mark Bennet Sep 13 '11 at 6:58
up vote 2 down vote accepted

Partial answer: for any $k \ge 2$, $k!$ will have a higher power of $2$ than the power of $5$ in its prime factorization, so new zeros will be added exactly when $k$ is a multiple of $5$. If there is any value of $k!$ with 99 zeros at the end of its decimal representation, then there is a first one, call it $k_{99}!$, and $k_{99}$ is a multiple of $5$. $(k_{99}+j)!$ for $j=1,2,3,4$ also must have 99 zeros, but $(k_{99}+5)!$ will have more than 99 zeros, because the $k_{99}+5$ term is a multiple of $5$ and will match with at least one existing factor of 2 to create one or more new zeros at the end of the decimal representation. So there are either 0 or 5 values of $k!$ ending in 99 zeros and all that's left is to determine which case it is.

For extra credit, see if there is a way to find the answer that is easier than actually trying to compute the value of $k_{99}$.

share|cite|improve this answer
Thanks! That's correct. – Jr. Sep 14 '11 at 0:40

Hint. A number ends in $0$ if and only if it is a multiple of $10$. A number ends in two zeroes if and only if it is a multiple of $100=2^2\times 5^2$. A number ends in three zeroes if and only if it is a multiple of $1000 = 2^3\times 5^3$. Etc. So, e.g., a number ends in exactly two zeroes if and only if it is a multiple of $100$ but not of $1000$.

share|cite|improve this answer

The number of trailing zeros in $k!$ is $\left\lfloor \frac{k}{5}\right\rfloor + \left\lfloor \frac{k}{5^2}\right\rfloor + \left\lfloor \frac{k}{5^3}\right\rfloor + ...$

This is approximately $\frac {k}{4}$ so for 99 zeros $k = 4\times99 = 396$ is a reasonable place to start looking.

share|cite|improve this answer

In order that k! end in 99 zeroes, it must have 99 factors of 10 and so 99 2's and 99 5's. Since there are going to be fewer 5's than 2's, k! must have exactly 99 5's. We first get that for k= 99*5= 495 and then get 100 5's for k= 100*5= 500. Any number from 495 to 499 will have exactly 99 5's in its factorial. There are 5 such numbers.

Actually, the answer is correct but the process has a little problem. 25=5^2 provides double 5. 125=5^3 provides triple 5. However,100 and 99 minus 3(1+2 extra 5) at the same time. Hence, it has the same answer with the solution above.

share|cite|improve this answer
The first paragraph is wrong, as you acknowledge in the second. The next to last sentence in the second doesn't make sense. – Ross Millikan Oct 18 '12 at 17:00
The second paragraph is used to modify the problem in the first paragraph, since I do not take 25 and 125 which provide more 5 than others into account. – John Hass Oct 19 '12 at 9:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.