# Proof that a repeating decimal has non-repeating digits after decimal iff denuminator has factors of 2 or 5 besides other prime factors

I'm studying a lesson about fractions. It classifies rational numbers into three categories based on their decimal representation.

1. Terminating Decimal: If a reduced fraction'denuminator has only prime factors of 2 or 5 or both (like $$\frac{3}{2^3\times 5}$$ or $$\frac{3}{2^3}$$ or $$\frac{3}{5}$$), then the decimal represention terminates at some point and is not periodic.

2. Simple Repeating Decimal: If a reduced fraction's denuminator has prime factors which are neither 2 nor 5 (like $$\frac{3}{7}$$ or $$\frac{5}{13}$$ or $$\frac{1}{3}$$), then the decimal representation is periodic and the repeating digits appear right after the decimal point.

3. Composite Repeating Decimal: If a reduced fraction's denuminator has prime factors 2 or 5 or both and also other prime factors (like $$\frac{3}{2\times 5^2 \times 7}$$ or $$\frac{3}{2^3 \times 13}$$ or $$\frac{3}{5 \times 3}$$), then the decimal representation has some non-repeating digits after the decimal point and after that the repeating digits appear.

I've searched for hours but did not found anything that classifies repeating decimals into simple and composite. I also found this question which is the same as mine but did not have a satisfying answer and was asked a little differently.

I want a proof of this:

There are factors of 2 or 5 or both on a reduced fraction's denuminator besides other factors $$\iff$$ fraction's decimal representaion has some non-repeating digits after the decimal point.

Update:-------------------------

I think if I can prove the following, then I can use that to prove the thing I mentioned above.

A reduced fraction's denuminator has only prime factors other than 2 and 5 $$\iff$$ Fraction's decimal representation has no non-repeating digits after decimal point.

• Hint: multiplication by powers of 10 * moves the decimal point right or left without changing the digits themselves, and * can be used to introduce or get rid of factors of 2 and 5 in a fraction's denominator. Commented Jun 29, 2023 at 16:21
• @GregMartin You're right but in order to prove using your hint, I need to prove two things: 1) if we have no powers of 2 and 5 then there are no non-repeating digits after the decimal. 2) your hint works if we have different powers of 2 and 5 in the denuminator. Commented Jun 29, 2023 at 16:30
• Begin with $1$ : If the prime factorization of the denominator is $2^a\cdot 5^b$ , then with $m:=max(a,b)$ , you get an integer by multiplying the fraction with $10^m$. This is the same as shifting the comma $m$ positions to the right , hence the original decimal expansion must terminate. Commented Jun 29, 2023 at 16:39
• Suppose , you have proven $2$ , then in $3$ you can again multiply with some suitable power of $10$ (analogue to $1$) to arrive at a fraction of the type in $2$. So, it remains to prove $2$. Commented Jun 29, 2023 at 16:42
• Hint if the digits repeat with period $r$ from the first digit after the decimal point then the denominator can be written $10^r-1$ (geometrical progression, not necessarily in lowest terms). This is not divisible by $2$ or $5$. Commented Jun 29, 2023 at 16:45

This answer assumes that we may use the followings :

• All rational numbers are either terminating decimal or repeating decimal numerals. (see here)

• 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$$. (see here)

We want to prove $$(1)\iff (2)$$ where

$$(1)$$ A reduced fraction's denominator has factors of $$2$$ or $$5$$ or both besides other prime factors.

$$(2)$$ The decimal representation has some non-repeating digits after the decimal point.

We prove $$(1)\iff (2)$$ using the following lemma :

(A proof of the lemma is written at the end of this answer)

Lemma : A reduced fraction's denominator is coprime to $$10$$ if and only if the decimal representation is periodic and the repeating digits appear right after the decimal point.

Proof that $$(1)\implies (2)$$ :

Since the denominator is not of the form $$2^a5^b$$, the decimal representation is periodic. Since the denominator is not coprime to $$10$$, it follows from the lemma that the repeating digits do not appear right after the decimal point. So, the decimal representation has some non-repeating digits after the decimal point.$$\ \square$$

Proof that $$(2)\implies (1)$$ :

It follows from the lemma that the reduced fraction's denominator is not coprime to $$10$$. Suppose that the denominator is of the form $$2^a5^b$$. Then, it has a terminating decimal expansion, which contradicts that the decimal representation is periodic. So, the denominator has factors of $$2$$ or $$5$$ or both besides other prime factors.$$\ \square$$

Finally, let us prove the lemma :

Lemma : A reduced fraction's denominator is coprime to $$10$$ if and only if the decimal representation is periodic and the repeating digits appear right after the decimal point.

Proof of the lemma :

("if" part)

Let $$r'=\overline{r_1r_2\cdots r_t}$$ be the repeating digits and $$N$$ be the integer part. Then, $$f$$ can be written as $$f=N+\dfrac{r'}{10^t-1}=\dfrac{N(10^t-1)+r'}{10^t-1}$$ whose denominator is coprime to $$10$$.

("only if" part)

Since the reduced fraction's denominator is coprime to $$10$$, the decimal representation is periodic.

We may suppose that $$f=\dfrac nd\lt 1$$ and that $$f=\dfrac nd=\overline{0.b_1b_2\cdots b_s[R][R]\cdots}$$ where $$[R]=\overline{r_1r_2\cdots r_t}$$ represents repeating digits.

Let $$r_0$$ be the reminder when we divide $$10^{s}n=\overline{b_1b_2\cdots b_s.[R][R]\cdots}$$ by $$d$$. Since $$\gcd(10^sn,d)=1$$, we see that $$\gcd(r_0,d)=1$$ with $$0.

Since $$\dfrac{r_0}{d}=\overline{0.[R][R]\cdots}$$, we get $$\dfrac{r_0}{d}=\dfrac{\overline{r_1r_2\cdots r_t}}{10^t-1}$$.

It follows from this that $$d$$ is a divisor of $$r_0(10^t-1)$$. Since $$\gcd(d,r_0)=1$$, we see that $$d$$ is a divisor of $$10^t-1$$.

Let $$u$$ be the smallest positive integer $$x$$ such that $$10^x\equiv 1\pmod d$$.

Then, $$u$$ is a divisor of $$t$$. (The reason is as follows : There are non-negative integers $$y,r$$ such that $$t=uy+r$$ and $$0\le r\lt u$$, so $$1\equiv 10^t\equiv 10^{uy+r}\equiv (10^u)^y\cdot 10^r\equiv 10^r\pmod{d}$$. Now, $$r\gt 0$$ contradicts that $$u$$ is the smallest positive integer such that $$10^x\equiv 1\pmod d$$. So, we have $$r=0$$ which implies that $$u$$ is a divisor of $$t$$.)

Since $$10^u-1$$ is a multiple of $$d$$, we see that $$n(10^u-1)$$ is also a multiple of $$d$$.

Therefore, $$\dfrac{n(10^u-1)}{d}$$ is an integer.

So, $$0\lt \dfrac nd\lt 1$$ implies $$0\lt \dfrac{n(10^u-1)}{d}\lt 10^u-1$$. So, $$\dfrac{n(10^u-1)}{d}$$ is a positive integer, and the number of the digits is at most $$u$$.

Letting $$\dfrac{n(10^u-1)}{d}=\overline{c_1c_2\cdots c_u}$$, we have $$\dfrac{n}{d}=\dfrac{\overline{c_1c_2\cdots c_u}}{10^u-1}=\overline{0.[R'][R']\cdots}$$ where $$[R']=\overline{c_1c_2\cdots c_u}$$.

This means that the repeating digits appear right after the decimal point.$$\ \blacksquare$$

Let’s show that a real number between $$0$$ and $$1$$ has a repeating decimal if and only if it is a fraction whose denominator is relatively prime with $$10$$.

Consider positive rational $$a/b$$ less than $$1$$ where $$b>1$$ is coprime to $$10$$. Let $$n=\phi(b)$$ Then by Euler’s Theorem, $$b|10^n-1$$, so we have that $$r=a/b\cdot (10^n-1)$$ is a positive integer less than $$10^n$$. We can denote the $$n$$ right digits (possibly 0) of $$r$$ as $$r=r_1…r_n$$, so $$a/b=r/(10^n-1)=0.\overline{r_1\dots r_n}$$ starts repeating immediately.

On the other hand, consider any fraction $$\overline{r_1\dots r_n}$$ which starts repeating immediately. Denoting $$r=r_1\dots r_n$$, we have $$\overline{r_1\dots r_n}=\frac{r}{10^n-1}$$ where we can note that $$10^n-1$$ is coprime to 10.

Note since (as you’ve noticed) all fractions eventually repeat, either a fraction immediately repeats and so can be reduced to a fraction with denominator relatively prime with $$10$$ (case 2), or it cannot in which case its denominator in must not be relatively prime with $$10$$.