# In 1/6=1.6666..., repeating 6 is called repeatend ( or reptend ) . I learn from https://en.wikipedia.org/wiki/Repeating_decimal, the reptend in the decimal form of 1/97 is a 96-digit string. Find fraction(s) having longer reptend string(s)?

Oct 16, 2016

We can find the fraction for an arbitrary repeating string with the following method:

Let $x = 0. \overline{{a}_{1} {a}_{2.} . . {a}_{n}}$, where $\overline{{a}_{1} {a}_{2.} . . {a}_{n}}$ denotes the repeating $n$-digit string ${a}_{1} {a}_{2.} . . {a}_{n}$.

$\implies {10}^{n} x = {a}_{1} {a}_{2.} . . {a}_{n} . \overline{{a}_{1} {a}_{2.} . . {a}_{n}}$

$\implies {10}^{n} x - x = {a}_{1} {a}_{2.} . . {a}_{n} . \overline{{a}_{1} {a}_{2.} . . {a}_{n}} - 0. \overline{{a}_{1} {a}_{2.} . . {a}_{n}}$

$\implies \left({10}^{n} - 1\right) x = {a}_{1} {a}_{2.} . . {a}_{n}$

$\therefore x = \frac{{a}_{1} {a}_{2.} . . {a}_{n}}{{10}^{n} - 1}$

So, for example, if we wanted a 1000-digit repeating string, we could let ${a}_{1} = {a}_{2} = \ldots = {a}_{999} = 0$ and ${a}_{1000} = 1$, and then we would have

$\frac{000. . .01}{{10}^{1000} - 1} = \frac{1}{{10}^{1000} - 1}$

give a repeating sequence of $999$ zeros followed by a $1$. Note that this method works to generate any repeating sequence.

If we let ${a}_{i}$ represent the ${i}^{\text{th}}$ digit of $\pi$, then

$\frac{{a}_{1} {a}_{2.} . . {a}_{10000}}{{10}^{10000} - 1}$

would generate a a repeating string of the first $10000$ digits of $\pi$.

We can also use a similar method to find the fraction for any rational value with a repeating string.

Given a general real number with a repeating string

${c}_{1} {c}_{2.} . . {c}_{j} . {b}_{1} {b}_{2.} . . {b}_{k} \overline{{a}_{1} {a}_{2.} . . {a}_{n}} , {a}_{i} , {b}_{i} , {c}_{i} \in \left\{0 , 1 , 2 , \ldots , 9\right\}$.

let
$a = {a}_{1} {a}_{2.} . . {a}_{n}$
$b = {b}_{1} {b}_{2.} . . {b}_{k}$
$c = {c}_{1} {c}_{2.} . . {c}_{j}$

Note that by the above work, we have $0. \overline{a} = \frac{{a}_{1} {a}_{2.} . . {a}_{n}}{{10}^{n} - 1}$

Then we can rewrite our number as

${c}_{1} {c}_{2.} . . {c}_{j} . {b}_{1} {b}_{2.} . . {b}_{k} \overline{{a}_{1} {a}_{2.} . . {a}_{n}} = c + {10}^{- k} b + {10}^{- k} \cdot 0. \overline{a}$

$= c + \frac{b}{10} ^ k + \frac{a}{{10}^{k} \left({10}^{n} - 1\right)}$

$= \frac{\left({10}^{k} c + b\right) \left({10}^{n} - 1\right) + a}{{10}^{k} \left({10}^{n} - 1\right)}$