Notifications
Mark all as read
Q&A

Why does the decimal expansion of $1/(10n - 1)$ have this neat pattern?

+10
−0

I was playing around with the reciprocals of some positive integers and found these interesting patterns:

$$ \frac{1}{19} = 0.\overline{052631578947368421} $$

Now, this repeating decimal can also be obtained by "concatenating" the powers of $2$ successively to the left as follows:

\begin{align} 1& \\ 21& \\ 421& \\ 8421& \\ {\color{red}{1}}68421 \\ {\color{red}{3}}{\color{green}{3}}68421 \\ \vdots\quad & \end{align} Notice that here I think of the red $\color{red}{1}$ of $16$ and $\color{red}{3}$ of $32$ as being "carried over", so the units digit of $32$ and the tens digit of $16$ add to give me the green $\color{green}{3}$. The sequence gets increasingly complicated as more terms are concatenated in this manner, but it definitely looks like it's converging to $\dotsc 052631578947368421$, where the ellipsis indicates that the pattern repeats forever towards the left. This is a bit surprising because (informally) this would mean that if I perform this pattern infinitely far out to the right of the decimal point, then I get the decimal expansion of $1/19$.

How can I go about making this idea precise?


Some more data for this pattern: \begin{align} \vdots\quad & \\ {\color{red}{3}}{\color{green}{3}}68421 \\ {\color{red}{6}}{\color{green}{7}}368421 \\ {\color{red}{1}}{\color{green}{34}}7368421 \\ {\color{red}{2}}{\color{green}{69}}47368421 \\ {\color{red}{5}}{\color{green}{38}}947368421 \\ {\color{red}{10}}{\color{green}{77}}8947368421 \\ \vdots\quad & \end{align}

In this pattern, one can see that at each stage one new digit from the required sequence is correctly added, despite all the carrying-over.

I have also observed this to be the case for the decimal expansion of $1/29$: $$ \frac{1}{29} = 0.\overline{0344827586206896551724137931} $$ In this case, we concatenate the powers of $3$ in a similar fashion.

Is there any significance to the fact that $19 = {\color{red}{2}}*10 - 1$ and $29 = {\color{red}{3}}*10 - 1$ to the use of powers of $2$ and $3$, respectively, in these computations?

I also checked for $1/39$, and though the repeating part of its decimal expansion is not as impressively long as for the other two cases, the pattern still holds up: $$ \frac{1}{39} = 0.\overline{025641} $$ and concatenating the powers of $4$ indeed gives $\dotsc 025641$.

The last case I checked was $1/49$, and it also obeys this pattern: $$ \frac{1}{49} = 0.\overline{020408163265306122448979591836734693877551} $$ and concatenating the powers of $5$ gives us this very repeating set of digits.

Of course, the pattern for $1/49$ makes it obvious that there is a concatenation that works in the forward direction: namely, the powers of $2$ concatenated in bunches of two digits. But this just means that $$ \frac{1}{49} = \frac{2}{100} + \frac{2^2}{100^2} + \frac{2^3}{100^3} + \dotsb $$ which is true by the formula for the sum of an infinite geometric series. So, "forward concatenating" patterns can be explained in this manner, but I'm stumped regarding how to explain the "backward concatenating" ones.

If anyone can throw some light on this, it would be greatly appreciated!

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comments

3 answers

+5
−1

First of all, there is indeed a pattern.

To figure out why, there's an easier example than what you've found: $$0.\bar{1} = \frac{1}{9}.$$

How does that work? $1$ is the only power of $1$: $1^n = 1$.

Now, how do we prove this? if $x = 0.\bar{1}$, then $10x = 1.\bar{1}$ and so, $9x=1$.

Hidden in that proof lies the answer for the other cases - you have some repeating number and in order to show what fraction that repeating number is equal to, here $1/\left(10n-1\right)$, you multiply it by $10n$ and subtract the number (again, I'll just call it $x$).

To take your example of $1/19$, we have that the fraction is $x = 0.\overline{052631578947368421}$, so we multiply by $20$ to get $20x = 1.\overline{052631578947368421}$, subtract $x$ and $19x = 1$. Crucially, the number left on the RHS after subtracting is exactly $1$, as everything after the decimal point cancels. It must do this, because the fraction is some integer divided by some other integer. That is, if $x=n/m$, then $mx=n$.

As we're in a decimal system, multiplying by $10$ is shifting one digit to the left. So, in doing this multiplication by $10n$, you're shifting the digit to the left, then multiplying by $n$, which is exactly the procedure outlined in the question.

Now, each particular digit (after this multiplication procedure) must cancel with the digit to the left so at this point, they must be equal and we have the exact behaviour outlined in your question.


To explain this generally and in more detail (taking $x<1$ wlog.) I'll use a fraction $$x = \frac{m}{10n-1}.$$

When written in decimal format, this is $x = 0.x_1x_2\ldots x_k\ldots$, with $x_{k+r}=x_k$ for some $r$, where each $x_k$ is a single digit (i.e. an integer in the range $0-9$ as we're in a decimal basis).

Now, we know that $\left(10n-1\right)x = m$, or $10nx - x = m$. However, m is an integer, so all the digits after the decimal point (the 'fractional part', in other words) are $0$.

This means that the digits in the fractional part of $10nx - x$ must also be $0$.

So, we look at the digits $x_r$ and $x_1\ldots x_{r-1}$.

The fractional part of $10nx -$ the fractional part of $x$ equals $0$, or the fractional part of $10nx$ equals the fractional part of $x$. For this to be the case, all the digits must be equal.

So, we take the digit $x_r$. To calculate $x_{r-1}$, we use the properties of the fractional parts being equal and multiplication by 10 as shifting the digit to the left to give that the fractional part of $10n\left(0.x_1\ldots x_r\right) - 0.x_1\ldots x_r = 0.0\ldots x_r$ (where the $0$s after the point are repeated $r-1$ times).

This is exactly what's written in the question, just in a different way: $nx_r \mod 10 = x_{r-1}$. Or, the digit to the left of $x_{r-1}$ is $nx_r$, with change. Accounting for this change gives that $x_{r-j} = n^jx_r$, which is where the powers of $n$ come from, the change being what needs to be added to digits further to the left.


To explain what I mean by phrases such as "Accounting for this change", let's take the initial stream of digits again and write them out more explicitly, where the number in brackets to the right of each line represents the number of times the 0 is repeated after the decimal point:

\begin{align*}x &= 0.0\ldots x_k \qquad(k-1)\\ &+ 0.0\ldots x_{k-1} \qquad(k-2)\\ &+ 0.0\ldots x_{k-2} \qquad(k-3) + \ldots\end{align*}

Now, we apply this procedure of multiplying by $10n$. It is a requirement that, because the fractional part of $x$ must equal the fractional part of $10nx$, $10nx-m=x$, that is

\begin{align*}10nx - m &= 0.0\ldots x_k \qquad(k-1)\\ &+ 0.0\ldots x_{k-1} \qquad(k-2)\\ &+ 0.0\ldots x_{k-2} \qquad(k-3) + \ldots\end{align*}

Taking this line by line (where the term in brackets on the LHS has $j-1$ $0$s after the decimal point and the superscripts denote that this series arises from the $j^{th}$ term in the similar expansion of $x$) gives that

\begin{align*}10n\left(0.0\ldots x_j\right) &= 0.0\ldots x_{k-1}^{(j)} \qquad(k-2)\\ &+ 0.0\ldots x_{k-2}^{(j)} \qquad(k-3)\\ &+ 0.0\ldots x_{k-3}^{(j)} \qquad(k-4) + \ldots\end{align*}

We can add this to the next term in the expansion of $x$ to get that (unfortunately at this point, notation gets very confusing but the first term on the left hand side has $j-1$ $0$s and the second, $j-2$) \begin{align*}10n\left(0.0\ldots x_j + 0.0\ldots x_{j-1}\right) &= 0.0\ldots x_{k-1}^{(j)} \qquad(k-2)\\ &+ 0.0\ldots x_{k-2}^{(j)} \qquad(k-3)\\ &+ 0.0\ldots x_{k-2}^{(j-1)} \qquad(k-3)\\ &+ 0.0\ldots x_{k-3}^{(j)} \qquad(k-4)\\ &+ 0.0\ldots x_{k-3}^{(j-1)} \qquad(k-4) + \ldots\end{align*}

Now, having done this, the $k^{th}$ term is exactly $$\sum_{j>k}0.0\ldots x_k^{(j)} \qquad(k-1),$$

which is the sum over $10n\times$ all the digits to the right of the $k^{th}$ digit, where you're only summing the resulting $k^{th}$ digit.

However, you can recursively apply this to get that the $k^{th}$ digit is the sum over $\left(10n\right)^p\times$ all the digits, $p$ positions to the right of the $k^{th}$ digit, where you're only summing the resulting $k^{th}$ digit.

This is precisely what's done in the question, although written in a different way and shows that the behaviour arises because the terms are required to be sums of powers of $10n$ of previous terms because this is a fraction with a denominator of $10n-1$.

Why does this post require moderator attention?
You might want to add some details to your flag.

8 comments

I'm confused how this answers the question of the pattern of digits. You only use the fact that x = 1/19 in your answer and don't explain what the significance of the powers of n is. (Or maybe my reading comprehension skills are poor...) Quintec‭ about 1 month ago

Thank you for your answer! I hope you won't mind if I say that I somehow feel this answer doesn't go all the way towards explaining why this "backwards concatenation" process appears. Specifically, I do understand that if $x = 0.\overline{x_1 x_2 x_3 \dotso x_r}$, then $x$ is a rational number equal to some $n/m$ that can be found as you outlined. However, why does this method of specifically concatenating the powers of $n$ work when considering $1/(10n - 1)$? Abheri Ragam‭ about 1 month ago

Secondly, though I say this "works", how do I adequately make sense of that? After all, the string that I get by my method of concatenation strictly speaking gives an "infinite number" such as $\dotsc 052631578947368421$. So perhaps, my claim is something like $$\frac{1}{10n-1} = \lim_{k \to \infty} \frac{(10n)^0 + (10n)^1 + (10n)^2 + \dotsb + (10n)^k}{10^k}\ ?$$ I'm not sure... But I do think there's a bit more to be said from where you leave off in your post :) Abheri Ragam‭ about 1 month ago

I've updated my answer (although honestly, I feel that the first bit is about 100 times clearer). I've included the bit about the powers of $n$ and what you're referring to as 'backwards concatenation' is what I'm referring to as 'multiplying a digit by $n$ to get the digit to the left'. It works because the '-1' is the bit that causes the fractional part to cancel, hence be equal Mithrandir24601‭ about 1 month ago

But, $x_{r-j}$ is not equal to $n^j x_r$! (I presume you meant modulo $10$?) For instance, for the decimal expansion of $1/19$, $x_{r-5} = 3$ but $2^5 x_r = 32 \neq 3 \pmod{10}$. In fact, they are not equal precisely because of the carrying-over happening in the concatenation process. I'm sorry, but I'm still not satisfied that your answer fully explains this phenomenon. Abheri Ragam‭ about 1 month ago

Show 3 more comments
+2
−0

I was pretty curious about this, so I posted a question on Math.SE. Most of this answer will draw from the idea of J. W. Tanner's answer there.


There is actually a simple reason why this pattern holds.

Lets start by examining how the digits are generated: each digit is a power of two (with carrying). We can withhold decimal shifting for a second and simply look at a simplified expression with the same digits, only generated to the left of the decimal point:

$$ \begin{aligned}\sum_{k=0}^{n-1} 2^k\cdot 10^k&=1+20+400+16000+320000+\cdots+2^{n-1}\cdot10^{n-1}\\ &=\cdots7368421\end{aligned} $$

You can see how the pattern generated is the same. Let's look at it another way, using the geometric series formula.

$$ \begin{aligned}\sum_{k=0}^{n-1} 2^k\cdot10^k&=\frac{1(1-20^n)}{1-20}\\ &=\frac{20^n-1}{19}\end{aligned} $$

At this point, it's pretty clear why the digits generated become the repeated decimal of $1/19$. You can see the denominator of $19$ right there!


If you're not satisfied with that observation, we can further note the following:

$$ \begin{aligned}\frac{20^n-1}{19}&=\frac{20^n}{19}-\frac{1}{19}\\ &=\frac{2^n}{19}\cdot10^n-\frac{1}{19}\end{aligned} $$

Let's specifically focus on $2^n/19$. Since we are interested in repeated groups of digits, let's let $n$ be a multiple of the totient of $19$, which is $18$. The reason we chose the totient is because of a useful property of modular arithmetic: $a^b\equiv 1\mod c$ if $a$ and $c$ are coprime and $b$ is a multiple of the totient of $c$ (Euler's theorem).

Clearly, $2$ is coprime to $19$, so letting $n$ be a multiple of $18$ gives us a remainder of 1 when dividing $2^n$ by $19$. Therefore, the digits after the decimal point of $2^n/19$ are the same as the digits of $1/19$.

Going back to the whole expression, we then multiply by $10^n$, bringing $n$ of those repeated digits over to the left of the decimal point. Everything to the right is canceled by the subtraction of $1/19$ (the digits must cancel, since the expression is an integer).

The result is the final number has its last $n$ digits be the first $n$ digits of $1/19$ when $n$ is a multiple of $18$, which is what we wanted to prove. (It's not difficult to generalize this for any $n$, but that's beyond this answer).


A similar result can be produced for any $10c-1$, where the digits will repeat every totient of $10c-1$ (though it may repeat before that) and the repeating portion will be the same as the digits of $1/(10c-1)$. Since it's basically the same process, I won't repeat it here.

Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment

Thank you! I've been considering what you say in your answer, and I'm now satisfied with the explanation :) Abheri Ragam‭ about 1 month ago

+0
−0

I think the simplest way to see how it works is as follows:

Given $x=\frac{1}{10n-1}$, it is easy to check that $\frac{x+1}{10}=nx$.

Now $\frac{x+1}{10}$ means shifting the digits to the right, with an $1$ added as the first decimal. For example, in the case of $x=1/19$, we have $$\frac{x+1}{10} = 0.1\overline{052631578947368421}.$$ But now we see that the additional digit matches the one at the end of the period, so we just can shift the period one to the left. At the same time on the left we use the equation derived above: $$2\cdot\frac{1}{19} = 0.\overline{105263157894736842}.$$ Thus multiplying by $2$ (or, in the general case, by $n$) is equivalent to shifting the digits one position to the right (and adding a $1$ at the first decimal, which gives the carry from the multiplication). Thus since the last digit of the original period was $1$, the digits to the left of it are successive powers of $2$ (with carry), or successive powers of $n$ in the general case.

So the only remaining question is why the period always ends in $1$. Well, since multiplying the number with $19$ (or, in the general case, with $10n-1 = 10(n-1)+9$) has to give $1=0.\overline{999999999999999999}$, the last digit of the period, when multiplied with the last digit of the denominator, that is $9$, must give $10k+9$ for some integer $k$. But that is clearly only possible if that last digit is $1$.

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comments

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!