Recurring decimal expansion of $\frac17$

If I understood correctly, your question is about why certain groups of digits in the decimal expansion of $1/7$ are multiples of $7$, and why they also have a factor of $2^n$.

For a short version: jump to the end of my answer, the following is an explanation which is not as clean as the last paragraph.

You achieved to express $1/7$ as a geometric series

$$7\cdot\sum_{n=1}^{\infty} \left(\frac2{100}\right)^n.$$

The $100$ is not very surprising, as we are talking about digits in the decimal system. So powers of $10$ are always present. What might be puzzling is where the $2$ comes from. The limit of the series is

$$7\cdot\frac{2/100}{1-2/100}=7\cdot\frac2{100-2}=7\cdot\frac2{98}$$

and the reason this perfectly works out to $1/7$ is because $98=\color{red}{2}\cdot7\cdot 7$. The reason why this works so perfectly for $7$ (and not for other numbers $-$ then it would not really be surprising), is that $7^2+1=50$ is exactly $10^{2}/{\color{red}{2}}$ (and this is where $2$ comes into the game).

Let me explain. If we want that groups of digits of $1/p$ such that they are multiples of $p$ itself, we have to express it as a geometric series

$$\sum_{n=1}^{\infty}\left[p\cdot\left(\frac{q}{10^k}\right)^n\right].$$

The $10^k$ is an artifact of the decimal system and makes that our digits are (to some extent) exactly of the form $p\cdot q^n$ (e.g. $7\cdot2^n$ in your case). There are some ways to tweak this system, but let's stick to it for now. Evaluating this series gives

$$p\cdot\frac{q/10^k}{1-q/10^k}=p\cdot\frac{q}{10^k-q}.$$

For this to perfectly be $1/p$, we need $10^k-q=q\cdot p^2$ (check it, everything cancels out). We rearrange this to

$$q=\frac{10^k}{p^2+1}.$$

Here you see why this works for $p=7$. Then it turns out we can choose $k=2$ to get $q=2$. Until now I found no other number for which we have $p^2+1$ in such a nice form. If you allow that the digit groups are of the form $\alpha p\cdot q^n$ with some additional factor $\alpha$, then we are looking for combinations in which $\alpha p^2+1$ divides $10^k$. It is still not easy to find such combinations, but I found one or two nicer ones.


Using my method, I found that

$$\frac1{127}\approx 0.\color{lightgray}{00}\color{red}{7874}\color{lightgray}{0}15748\color{lightgray}{0}\color{red}{31496}\color{lightgray}{0}62992\color{red}{125984}251\, ...$$

which turned out to be generated by

\begin{align} \color{lightgray}{00}\color{red}{7874} &= 127 \cdot 31 \cdot 2^1 \\ \color{lightgray}{0}15748 &= 127 \cdot 31 \cdot 2^2 \\ \color{lightgray}{0}\color{red}{31496} &= 127 \cdot 31 \cdot 2^3 \\ \color{lightgray}{0}62992 &= 127 \cdot 31 \cdot 2^4 \\ \color{red}{125984} &= 127 \cdot 31 \cdot 2^5 \\ \cdots \end{align}

This example uses $q=2$, $k=6$, $p=127$ and $\alpha=31$. The reason for this nice pattern (and the occurence of $\color{red}2^n$) is again that $127^2\cdot31+1=500000=10^6/\color{red}2$.

When you are less restrictive on this kind of occuring pattern, e.g. $p$ needs no longer to be part of the digit sequence of $1/p$, then we can build an even nicer example from the one above:

$$\frac1{127^2}\approx 0.\color{lightgray}{0000}62\color{lightgray}{000}124\color{lightgray}{000}248\color{lightgray}{000}496\color{lightgray}{000}992\color{lightgray}{00}1984\color{lightgray}{00}3968\,...$$

where the black digits are just $31\cdot 2^n$.


Another crazy example is

$$\frac1{17}\approx 0.\color{lightgray}0\color{red}{58823529411764705882352941176470588235294}11764705\, ...$$

which follows the pattern $a(n)=17\cdot 1730103806228373702422145328719723183391\cdot 2^n$. For small values of $n$ we find

\begin{align} a(1)&=\color{lightgray}0\color{red}{58823529411764705882352941176470588235294}\\ a(2)&=117647058823529411764705882352941176470588\\ \cdots \end{align}

as expected. Unfortunately the numbers are so long that I cannot really show you how perfectly it fits. This pattern uses $p=17$, $q=2$, $k=42$ and an enormous $\alpha$ seen above. Once again we observe $17^2\cdot \alpha+1=10^{42}/\color{red}2$.


A more technical observation

Thinking about the problem so much brought me to an even more direct insight.

Let $q$ be a divisor of $10^k$ and $10^k/q-1=a\cdot b$. Then the digit pattern of the decimal representation of $1/a$ contains the sequence $b\cdot q^n$.

Proof.

$$\frac1a=b\cdot\frac1{ab}=b\cdot\frac1{10^k/q-1}=b\cdot\frac{q/10^k}{1-q/10^k}=\sum_{n=1}^{\infty} \left[b\cdot \left(\frac q{10^k}\right)^n\right].\qquad\square$$

This was used above and can be seen in all of the examples, e.g.

$$7\cdot7=\frac{10^2}2-1,\qquad 127^2\cdot 31=\frac{10^6}2-1$$

This shows a nice duality. Because of the symmetry between $a$ and $b$ we also see that $1/31$ contains the pattern $127^2\cdot 2^n$. No such duality can be observed in $1/7$ because this was the one case with $a=b=7$. We also see that the only possible values for $q$ are $2^s5^r$ because these are the only possible divisors of $10^k$.

This final observation allows us to generate an infinitude of examples with nice digit patterns. So I will simply stop here despite the problem really catching my attention. The examples presented above are not so nice in this new light but you can certainly find better ones now.


Observe the pattern of $\dfrac1{49}=\dfrac2{100-2}$:

$$0.020408163265306122448979591836734693877551020408163265306\cdots$$

As a sum of terms $\dfrac{2^k}{100^k}$, it shows the successive powers of two in digit pairs, which is quickly destroyed by carries.

Now if you multiply by $7$, you will see the last two digits of $7\cdot2^k$, until carries hide them. But as the period is $6$ (which is maximal), only one pair is perturbed.


The phenomenon can be more striking with $\dfrac1{7142857}$,

$$0.00000014000000280000005600000112000002240000044800000896000\cdots$$

due to the fact that $7\cdot7142857=49999999$, so that you find the $8$ first digits of the multiples of $7$ by powers of $2$.