I discovered that the decimal representation of 15/17 consists of an endlessly repeating sequence of 16 digits. I wonder what rational number has the longest sequence of repeating digits?
You might find useful this reference (also the other subheadings)
Wikipedia - Repeating decimal - subheading Other properties of repetend lengths
You might also like to think backwards; given any positive decimal expansion with a repetend, we can find unique positive integers p,q such that gcd(p,q)=1 and p/q has the given value.
Hello, StevenBrown!
You discovered this on your own? . . . Good for you!
Keep exploring . . . there's some fascinating stuff out there!
I discovered that the decimal representation of $\displaystyle \frac{15}{17}$
consists of an endlessly repeating sequence of 16 digits.
I wonder what rational number has the longest sequence of repeating digits?
Considerable exploration has already been done on this subject.
Here are some basics that I remember . . .
If $\displaystyle p$ is a prime, the decimal for $\displaystyle \frac{1}{p}$ has a $\displaystyle p-1$ digit repeating cycle.
However, some primes can have even shorter cycles.
For example: .$\displaystyle \begin{Bmatrix}\frac{1}{11}\text{ has a 2-digit cycle:} &0.\overline{09} \\ \\[-3mm]
\frac{1}{13}\text{ has a 6-digit cycle:} & 0.\overline{076923} \\ \\[-3mm]
\frac{1}{37} \text{ has a 3-digit cycle:} & 0.\overline{027}\end{Bmatrix}$
What determines the length $\displaystyle n$ of the cycle for prime reciprocals?
It is the least $\displaystyle n$ for which $\displaystyle 10^n-1$ is divisible by $\displaystyle p.$
In baby-talk, consider a string of 9's.
Begin dividing by a prime $\displaystyle p.$
When it "comes out even", stop.
The number of 9's is the length of the cycle.
Example: $\displaystyle \frac{1}{7}$
The first time the division stops is: .$\displaystyle 999999 \div 7 \,=\,142857$
. . Therefore, $\displaystyle \frac{1}{7}$ has a 6-digit cycle.
Example: $\displaystyle \frac{1}{37}$
The first time the division stops is: .$\displaystyle 999 \div 37 \,=\,27$
. . Therefore, $\displaystyle \frac{1}{37}$ has a 3-digit cycle.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Here's another interesting feature . . .
. . $\displaystyle \begin{array}{ccc}
\frac{1}{7} &=& 0.\overline{142857} \\ \\[-3mm]
\frac{2}{7} &=& 0.\overline{285714} \\ \\[-3mm]
\frac{3}{7} &=& 0.\overline{428571} \\ \\[-3mm]
\frac{4}{7} &=& 0.\overline{571428} \\ \\[-3mm]
\frac{5}{7} &=& 0.\overline{714285} \\ \\[-3mm]
\frac{6}{7} &=& 0.\overline{857142} \end{array}$
The last five decimals are cyclic arrangements of the first one.