If $x$ is prime and $1000000000000 < x < 1000100000000$,
how can I detect if $1 / x$ will result in a terminal decimal or not?
I can use programming.
Asked
Active
Viewed 472 times
0

SuprDewd
- 121
2 Answers
7
If "terminal" means the decimal expansion is eventually zero, then no such number has a terminal expansion. $1/x$ has a terminal expansion iff $x=2^a 5^b$ for some $a$, $b$.

Chris Eagle
- 33,306
7
Suppose that $p$ is a prime other than $2$ or $5$. Then if $\frac{1}{p}$ was a terminating decimal, we would have that $\frac{10^n}{p} = a$ for some $n,a \in \mathbb{N}$. But this is a contradiction since $p$ clearly doesn't divide $10^n$.
Hence $\frac{1}{p}$ is not a terminating decimal for any prime $p$ other than $2$ or $5$.

J. J.
- 9,432
-
Thanks! Exactly what I was looking for! – SuprDewd Jan 09 '11 at 16:24