Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
See:… – Timere Oct 27 '13 at 7:09
up vote 1 down vote accepted

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$

share|cite|improve this answer
That's not enough to yield a rigorous proof - see my answer. – Bill Dubuque 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.

share|cite|improve this answer

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.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.