# Elementary way to prove that if $n$ and $10$ are coprime, then $1/n$ has no transient digits.

With Euler-Fermat's theorem at hand it's easy to prove that if $$\gcd(n,10)=1$$ then the decimal expansion of $$1/n$$ is repeating, and that there is no transient (that is, digits after the point before the repetend). With pigeonhole principle we can show easily that $$1/n$$ is repeating, but I don't know how to prove that there is no transient.

I'd like to show my pupils (that don't know anything about group theory or congruences) that the repeating decimals that have transient are represented by fractions whose denominator has $$2$$ or $$5$$ as a factor.

• I'm not a native English speaker. I found the words 'transient' and 'repetend' looking about this kind of numbers in the Wikipedia. If there are more stantard words for these concepts, please feel free to edit the question or suggest me to use them instead. Sep 19, 2019 at 15:58
• It's still unclear to me what transient and repetend means, could you provide an example or link please? Sep 19, 2019 at 16:12
• Take for example $47/110=0.4272727\ldots$. Then $'4'$ is the transient and '$27$' is the repetend. Sep 19, 2019 at 16:48
• "Preperiod" is more common that "transient" Sep 19, 2019 at 17:58
• Work backwards. If you have $n$ goes into $10k$, $a$ times with remainder $r$ and later down the road you have $n$ goes into $10m$ also $a$ times with $r$ remainder then $k = m$. Thus you can never get to point of repetition except from one path. Sep 19, 2019 at 23:51

To show that $$\frac{1}{2^a 5^b}$$ has a finite decimal, let $$c = \max \{a,b\}$$ and consider $$\frac{1}{2^a 5^b} = \frac{1}{2^a 5^b} \cdot \frac{2^{c-a} 5^{c-b}}{2^{c-a} 5^{c-b}} = \frac{2^{c-a} 5^{c-b}}{10^c} \text{,}$$ which has a finite decimal expansion whose digits are those of $$2^{c-a}5^{c-b}$$.

Now suppose we have $$\frac{1}{2^a 5^b c}$$, where $$\gcd(c,10) = 1$$. Suppose $$\frac{1}{2^a 5^b c} = \frac{d}{10^e} \text{,}$$ that is, $$\frac{1}{2^a 5^b c}$$ has a terminating decimal expansion whose digits are the digits of $$d$$. But then $$10^e = 2^a 5^b c d$$ Since the prime factorization of $$10^e$$ is $$2^e 5^e$$, the only primes appearing on the right-hand side are $$2$$ and $$5$$. Since $$\gcd(c,10) = 1$$, this forces $$c = 1$$. As a consequence, if $$c \neq 1$$, $$\frac{1}{2^a 5^b c}$$ does not have a terminating decimal expansion.

Warm up: $$\frac{1}{30} = 0.0\overline{3} \text{,}$$ but also \begin{align*} \frac{1}{30} &= \frac{1}{3} - \frac{3}{10} \\ &= 0.\overline{3} - 0.3 \text{.} \end{align*} So what we need to do is find a way to separate the given fraction into one that contains the part that has a denominator of $$2^a 5^b$$ and a part that has the maximal denominator relatively prime to $$10$$.

Suppose we are to understand $$a/b$$ and $$\gcd(b,10) = c$$, so $$b = c \cdot d$$ with $$\gcd(d,10) = 1$$. We want $$\frac{a}{b} = \frac{\text{something}}{c} + \frac{\text{another something}}{d} \text{.}$$ The second fraction will tell us about the repetend and the first fraction will tell us about the modification of the leading digits of the repetend to make the transient initial segment. We use the extended Euclidean algorithm to find the unknown numerators.

Let's do another example to see how to find the two numerators. Let's look at $$1/175$$. We want to find $$e$$ and $$f$$ such that $$\frac{1}{175} = \frac{e}{7} + \frac{f}{25} \text{.}$$ Clearing denominators, $$1 = 25e + 7f$$ Using the extended Euclidean algorithm, we find that $$\gcd(25,7) = 1$$ (which we already know is true, by construction) and also $$2 \cdot 25 + (-7) \cdot 7 = 1$$. So, $$e = 2$$ and $$f = -7$$ work. We find out \begin{align*} \frac{1}{175} &= \frac{2}{7} - \frac{7}{25} \\ &= 0.\overline{285714} - 0.28 \\ &= 0.00\overline{571428} \text{.} \end{align*}

Notice that our construction shows that, in some sense, we should think of the repetend of $$1/175$$ to be $$285714$$, with the transient initial segment being altered to suppress the first two digits, rather than thinking of the repetend starting on the third decimal digit.

• As far as I understood your answer, it would prove that decimals with transient have $2$ as a factor of the denominator, or $5$, or both. But what I intend to prove is the reciprocal: that is, that if the decimal expansion has no transient then $2$ or $5$ are not factors. On the other hand, your proof is elementary, theoretically, but pupils 15 years old won't understand a letter; actually we needed to read it thrice to see the point. I'll upvote but my question remains unsolved. Sep 19, 2019 at 16:38
• I mean 'I', not 'we' Sep 19, 2019 at 16:45
• @ajotatxe : I've added an elementary method to see $2^{-a} 5^{-b}$ has a terminating decimal expansion. Sep 19, 2019 at 22:14
• You probably meant $\frac{1}{2^a 5^b}$ instead of $\frac{1}{2^a 3^b}$ in the second paragraph.
– robjohn
Sep 19, 2019 at 23:07
• @robjohn : I did, in fact. Thanks! Fixed. Sep 19, 2019 at 23:45

The digits $$n_1\dots n_2-1$$ of $$\frac1m$$ form a repeating block when $$10^{n_1-1}\equiv10^{n_2-1}\pmod{m}$$. Note that if $$(10,m)=1$$, and $$10^{n_1-1}\equiv10^{n_2-1}\pmod{m}$$, then $$10^0\equiv10^{n_2-n_1}\pmod{m}$$. That means that digits $$1\dots(n_2-n_1)$$ form a repeating block.

• Sorry, this does assume that $10$ is invertible mod $m$
– robjohn
Sep 19, 2019 at 23:31

Bear in mind:

$$m_1 = 10$$ and $$10=d_1*n + r_1; 0\le r_1 < n$$ and $$d_1$$ is the first digit.

$$m_2 = 10*r_1$$ and $$m_2 = d_2*n + r_2; 0\le r_2 < n$$ and $$d_2$$ is the second digit.

And so on.

$$m_{k+1} = 10r_k$$ and $$m_{k+1}=d_{k+1}*n +r_{k+1};0\le r_{k+1} < n$$ and $$d_k$$ is the $$k$$th digit.

And as $$n$$ and $$10$$ are relatively prime we never have $$r_{k+1}=0$$ and as there are only $$n$$ possible $$r_k$$ we must get a repetition and once we do we get an infinite loop.

But suppose we get a case where $$r_k = r_v$$ (and thus $$m_{k+1}=10r_k = m_{n+1}=10r_v$$ and $$m_{k+1} = 10d_{k+1} + r_{k+1}= m_{v+1}=10d_{m+1} + r_{v+1}\implies d_{k+1}=d_{v+1}; r_{k+1}=r_{v+1}$$ and so on...)

Does this mean that $$m_k = 10*r_{k-1} = d_k*n + r_k$$ and $$m_v = 10*r_{v-1}= d_v*n + r_v = d_v*n + r_k$$ implies $$d_k = d_v$$ and so $$r_{k-1} = r_{v-1}$$?

If $$d_k \ne d_v$$ but $$r_k = r_v$$ then $$10r_{k-1} = d_k*n + d_k$$ and $$10r_{v-1} = d_v*n + d_v$$ the $$10r_{k-1}-10r_{v-1} = 10(r_{k-1}-r_{v-1}) = n*(d_k-d_v)$$.
But $$n$$ and $$10$$ are coprime so either $$n|r_{k-1}-r_{v-1}$$ or $$d_k-d_v = 0$$ (or both). But $$-(n-1) < r_{k-1}-r_{v-1} < n-1$$ so if $$n|r_{k-1}-r_{v-1}$$ then $$r_{k-1}-r_{v-1}=0$$ and $$r_{k-1}=r_{v-1}$$ and so $$d_k$$ and $$d_v = 0$$.
If id $$d_k = d_v$$ then ... $$10r_{k-1} = 10r_{v-1}= 10d_k + r_k =10d_v + r_v$$ and $$r_{k-1} = r_{v-1}$$.
So, yes $$r_{k-1} = r_{v-1}$$ and $$d_k = d_v$$. So by induction no-where can any $$d_i$$ and $$d_{i+(v-k)}$$ differ.