I recently stumbled upon an observation: the fraction $\frac{x}{y}$ terminates if and only if $y$ only has prime factors $2$ and $5$.
For example:
$$\frac{1}{20} = \frac{1}{2\cdot2\cdot5} = 0.05$$ $$\frac{1}{6} = \frac{1}{2\cdot3} = 0.1\bar6$$
I think this is true because fractions are in the form:
$$\frac{a}{10} + \frac{b}{100} + \frac{c}{1000} + \ldots$$ $$\frac{a}{2\cdot5} + \frac{b}{2\cdot2\cdot5\cdot5} + \frac{c}{2\cdot2\cdot2\cdot5\cdot5\cdot5} + \ldots$$
How can I rigorously prove this?
HINT: You basically have it. To say that you have a terminating decimal means that $$\frac xy = \frac m{10^s}$$ for some integer $m$ and positive integer $s$. Since the only factors of $10^s$ are ..., the only possible factors of $q$ are ... . (Why? What are you tacitly assuming about $x$ and $y$?)