[Math] Why are only fractions with denominator 2 and 5 non-repeating

alternative-proofelementary-number-theoryfractionsnumber-systems

Given a rational number $\frac{n}{d}$, I understand that in the base $10$ number system, the number can be represented as a non-repeating decimal number if and only if $d$ has only prime factors of $2$ and $5$.

I have a hypothesis that the reason for this is because $2$ and $5$ are the prime factors of $10$, which is the base for our number system. So according to my hypothesis, on a base $6$ number system, a rational number could be represented as a non-repeating decimal if and only if the denominator's only prime factors are $2$ and $3$.

But this is just a hypothesis, I don't know exactly why it is true. I'm not sure what the connection is between the prime factors of the base, and whether or not a rational number will be a repeating decimal. Can someone demonstrate why this holds true?

Best Answer

Your hypothesis is true. In base $b$, the expansion of $\frac nd$ (with $n,d$ coprime) is terminating (i.e. ends in repeating $0$s) if and only if $b^k\cdot\frac nd$ is an integer for sufficiently large $k$ (take for $k$ the number of digits after the period). That is $d$ must divide $b^k$. This implies that $d$ must not have any prime divisor except those dividing $b$, and vice versa for such $d$ it is always possible to find suitable $k$.

Related Question