Wednesday, April 5, 2017

algebra precalculus - Given $n$, find smallest number $m$ such that $m!$ ends with $n$ zeros

I got this question as a programming exercise. I first thought it was rather trivial, and that $m = 5n$ because the number of trailing zeroes are given by the number of factors of 5 in $m!$ (and factors of 2, but there are always a lot more of those).



But it seems like this is not true, because I'm not getting the correct answers for certain $n$. Any hints?

No comments:

Post a Comment

analysis - Injection, making bijection

I have injection $f \colon A \rightarrow B$ and I want to get bijection. Can I just resting codomain to $f(A)$? I know that every function i...