Prove that if a rational number's decimal expansion ends in $00000000...$, then the denominator is of the form $2^a \cdot 5^b$, $a,b \ge 0$

I have come up with a proof, but there's a missing brick.

Let $\frac{m}{n}$ be a rational number where $m,n$, have no common factors. Let the decimal expansion of $\frac{m}{n}$ end with $00000...$ Let us represent the decimal expansion of this number as $$\frac{m}{n} = a_0.a_1a_2...0000\ldots$$ Let $k$ be the index of the last non-zero decimal place. Then $$\frac{m}{n} = a_0.a_1a_2...a_k0000\ldots$$ Then $$10^k\cdot\frac{m}{n} = a_0a_1a_2...a_k.0000\ldots$$ such that $10^k\cdot\frac{m}{n}$ is obviously an integer. Let $$10^k\cdot\frac{m}{n} = p$$ $$\Rightarrow n = 10^k\cdot \frac{m}{p}$$

This is where my "missing brick" is needed. Because $m, n$ have no common factors, $m$ is not a multiple of $p$.

I am not certain about that statement but it intuitively seems correct.

After that, we deduce that $p$ is either a multiple of $5$ or $2$ or both, and the result follows.

• If $\alpha =.\overline {a_1\cdots a_k}$ then $\alpha = \frac {\overline {a_1\cdots a_k}}{10^k}$ so it is already written as the quotient of two integers and we note that the denominator is only divisible by the primes $2$ and $5$.
– lulu
Commented Jul 10, 2017 at 20:38
• $\frac{m}{n}=\frac{p}{10^k}$. You know $p$ is an integer, and so there you have it. (simplifying the fraction won't add any other prime factors to the denominator) Commented Jul 10, 2017 at 20:39
• assume $\frac mn$ is in lowest terms. $n$ divides $10^k,$ $m$ and $p$ are irrelevant at this point. Commented Jul 10, 2017 at 20:39
• In your last but one line there is the answer. $p$ must be an integer, then in the LHS $n$ must divide $10^k$, that is it be of the form $2^a\cdot 5^b$ Commented Jul 10, 2017 at 20:48

You want to observe that since $p$ is an integer, $n$ divides $10^km$. When $\gcd(m,n)=1$, this can only happen when $n|10^k$. Why?
$$a_0.a_1 \dots a_k 0 0 0 \bar 0 = \frac{a_0 \,a_1 \dots a_k}{10^k} = \frac{a_0\, a_1 \dots a_k}{2^k5^k}.$$
Now cancel as many $2$'s and $5$'s as you can. You'll be left with an integer $N$ upstairs divided by $2^m5^n$ downstairs for some $m,n \ge 0,$ with $N$ and $2^m5^n$ relatively prime.