# number has terminating decimal iff it's denominator, when in lowest terms, is coprime to all primes except 2 and 5.

Show that a number has a terminating decimal expansion if and only if, it is rational and when in lowest terms, its denominator is coprime to all primes other than 2 and 5.

This is an unsolved question in my lecture notes. I can only seem to prove the converse direction for this. Would appreciate a solution for the other direction.

For converse direction:

let the number, in lowest terms, be given by $\frac{l}{m}$ where $m = 2^ \alpha 5^\beta$, for some positive integers, $\alpha$ and $\beta$.

if $\alpha > \beta$, let $k = 5^{(\alpha-\beta)}$

if $\alpha < \beta$, let $k = 2^{(\beta-\alpha)}$

then $\frac{l}{m} = \frac{kl}{k2^\alpha5^\beta}=\frac{kl}{10^q}$

where q = max($\alpha,\beta$).

hence $\frac{l}{m}$ is a terminating decimal.

-

## 3 Answers

If the denominator has a prime factor other than $2$ and $5$, there is no power of $10$ that it divides. If you assume it terminates after $n$ decimals, the denominator must divide $10^n$

-

That's not enough to yield a rigorous proof - see my answer. – Gone Sep 18 '12 at 18:08

Let $n$ be the terminating decimal in question, and let $a =n\cdot10^m$, where $m$ is the number of places in the decimal expansion after the decimal point. Then $n=\frac{a}{10^m}$, the denominator of which is co-prime to any prime other than 2 or 5, no matter how many cancellations occur when simplifying.

-

This is a consequence of unique factorization, which implies uniqueness of the lowest-terms representation of fractions. Suppose the real $\rm\,r\,$ has $\rm\:k\:$ nonzero digits after the decimal point. Then multiplying it by $\rm\,10^k$ shifts the decimal point right by $\rm\,k\,$ digits, hence yields an integer, i.e. $\rm\: 10^k r = n\in \Bbb Z.\:$ Thus $\rm\: r = n/10^k\:$ so canceling common factors to reduce this fraction to lowest terms yields a fraction whose denominator divides $\rm\:10^k\! = 2^k 5^k.\:$ By unique factorization the only such divisors are $\rm\:2^i 5^j\:$ for $\rm\:i,j \le k.\:$ Also by unique factorization the lowest terms representation of a fraction is unique, so there cannot exist another equivalent fraction in lowest terms whose denominator has prime factors other than $2$ and $5$. This completes the proof.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 31, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9061077237129211, "perplexity_flag": "head"}