Last step in a simple proof:

69 Views Asked by At

I've been writing a little algorithm, and I find it fun (and hopefully beneficial) to write the mathematical proofs that justify the algorithm's function.

Along those lines, I've written the following proof. However, my last statement is just intuition, and I'd like to convince myself of it:

For any $n$, if $n= 2^x5^y$, then $1/n$ produces a terminating decimal number.

Proof:

Assume that n is of the form (2^x)(5^y). Choose $d = \max\{x, y\}$

$\implies$ Then $10^d/n = (2^d)(5^d)/(2^x)(5^y)$

$\implies$ Without loss of generality, assume that d = max{x, y} = x

$\implies$ 10^d/n = (2^x)(5^x)/(2^x)(5^y) = 5^(x - y), which is an integer.

$\implies$ In other words, $10^d \bmod n = 0$. For base 10, this gaurantees that 1/n is a terminating decimal.

I think, for a lot of people, no extra steps would be necessary. But I am writing this for people like me who need to understand every detail along the way.