Prove that $\frac{p}{q}$ is a rational number with a finite decimal expression if $p$ is an integer and $q=(2^n)(5^m)$ Let $p,q$ be two integers and $q=(2^n)(5^m)$. Then $\frac pq$ is a rational number with a finite decimal expression.
Any ideas how to do this? I've been thinking about it all day but I have no idea how to use the hypothesis that $q=(2^n)(5^m)$
 A: Rather than just give you the answer, do you see how to multiply both the numerator and denominator of $\frac{p}{q}$ by appropriate powers of 2 and 5 so that you obtain a denominator which is an integer power of 10?
A: Consider $ \frac{d}{2} $ where d is between 1 and 9.  All these cases have finite expansions. Likewise for $ \frac{d}{5} $.  Any finite expansion will end with a digit between 1 and 9 so any finite expansion will remain finite.
We can use this to create an inductive proof. $ \frac{p}{2^05^0} $ is finite because all integers are finite.
If $ \frac{p}{2^n5^m} $ is finite then $ \frac{p}{2^{n+1}5^m} $ and $ \frac{p}{2^n5^{m+1}} $ are finite due to the argument given above.
So it is true for natural numbers n and m.
A: Assuming $m$ and $n$ are positive integers[*].  Then consider
$$\frac p q = \frac p {2^n5^m} = \frac {p \cdot 2^{\max(m,n) -2}\cdot 5^{\max(m,n) -m}}{2^n5^m2^{\max(m,n)-n}5^{\max(m,n)-m}} = \frac { {p \cdot 2^{\max(m,n) -2}\cdot5^{\max(m,n) -m}}}{2^{\max(m,n)}5^{\max(m,n)}} = \frac { {p \cdot 2^{\max(m,n) -2}\cdot 5^{\max(m,n) -m}}}{10^{\max(m,n)}}= \frac P{10^k}$$
where $P = p \cdot 2^{\max(m,n) -2}\cdot 5^{\max(m,n) -m}$ is an integer and $k = \max(m,n)$ so $10^k$ is a power of 10.  
An integer divided by a power of 10 is a terminating decimal clearly.

[*]  If $m, n$ aren't necessarily positive integers then $1/3 = 1/2^{\log_3 2}5^0$ is a counter example.
A: $$
\frac{19}{2^7 \cdot 5^4} = \frac{19\cdot 5^3}{2^7 \cdot 5^7} = \frac{19\cdot 5^3}{10^7}.
$$
Do something similar with exponents other than the ones here, i.e. other than $7$ and $4$, and get a power of $10$ in the denominator.  Then you're done.
