Is there a general pattern behind the decimal expansion of $\frac{1}{7}$ being $.14+.0028+.000056+.00000112+...=.\overline{142857}$? I wondered if all decimal expansions of $\frac{1}{n}$ could be thought of in such a way, but clearly for $n=6$,
$$.12+.0024+.000048+.00000096+.0000000192+...\neq.1\bar{6}$$
Why does it work for 7 but not 6? Is there only one such number per base, i.e. 7 in base 10? If so what is the general formula?
 A: The expansion in your title formula is effectively $\displaystyle \sum_1^\infty 7 \times \left(\frac{2}{100}\right)^n = 7 \times \frac {1}{49} = \frac {1}{7}$
Simpler similar ones might be $\displaystyle \sum_1^\infty 2 \times \left(\frac{2}{10}\right)^n = 2 \times \frac {1}{4} = \frac {1}{2}$, i.e. $0.4 + 0.08 +0.016 + \cdots = 0.5$ or $\displaystyle \sum_1^\infty 3 \times \left(\frac{1}{10}\right)^n = 3 \times \frac {1}{9} = \frac {1}{3}$, i.e. $0.3 + 0.03 +0.003 + \cdots = 0.333\ldots$ or $\displaystyle \sum_1^\infty 1 \times \left(\frac{5}{10}\right)^n = 1 \times \frac {1}{1} = 1$, i.e $0.5 + 0.25 +0.125 + \cdots = 1$.
To get $\frac {1}{6}$, a possibility, though not so pretty, is  $\displaystyle \sum_1^\infty 4 \times \left(\frac{4}{100}\right)^n$ i.e. $0.16 + 0.0064 +  0.000256 + \cdots = 0.1666\ldots$.
One approach to getting $\frac {1}{k}$ is to look for a multiple of $k$ (say $mk$) which is one less than a number whose prime factors are $2$ or $5$.  Then $mk+1$ will divide some power of $10$ (say $10^h =g (mk+1)$).  You will then be able to write  $\displaystyle \sum_1^\infty m \times \left(\dfrac{g}{10^h}\right)^n = m \times \frac {1}{mk} = \frac {1}{k}$.  In your original example $k=7, m=7, g=2, h=2$, but apart from having $k=m$ as in my next three examples, there is nothing particularly special about it. 
A: Do you know about geometric series? Your series is really
$$7(0.02 + 0.0004 + \cdots) = 7 \frac{2/100}{1 - 2/100} = 7 \cdot \frac{1}{49}$$
When you replace $7$ by something else, say $n$, your series is similarly $n \frac{2/100}{1 - 2/100} = \frac{n}{49}$. 
In particular, only when $n = 7$ would that be equal to $\frac{1}{n}$.
A: Your expansion comes from the fact that you can write:
$$\frac{1}{7}=\frac{7}{50}\sum_{k=0}^\infty 50^{-k}=0.14(1+2\cdot0.01+4\cdot0.0001+\ldots)$$
You can check the equality by using the standard result that for $|q|<1$ you have $\sum_{k=0}^\infty q^k=\frac{1}{1-k}$.
It doesn't work for $6$ because if you wanted a structurally similar sum, you'd have:
$$\frac{1}{6}=\frac{49}{6\cdot50}\sum_{k=0}^\infty 50^{-k}$$
and the fraction on the left does not have a finite decimal expansion.
A: Please rectify me as I could not find following expression explicitly
$$\frac17=\frac{14}{98}=\frac{14}{100\left(1-\frac2{100}\right)}=\frac{14}{100}\left(1-0.02\right)^{-1}$$
$$=0.14[1+0.02+(0.02)^2+(0.02)^3+\cdots]$$
