Every rational number either stops after a few decimal digits or drifts into a pattern that loops forever. The loopers are the interesting ones. \dfrac{1}{7}, \dfrac{1}{11}, \dfrac{1}{13} all belong to this family, and each has its own personality: \dfrac{1}{7} cycles through a lush six-digit block, \dfrac{1}{11} loops in just two digits, and \dfrac{1}{13} shares its block with \dfrac{1}{7} in a way that feels almost mischievous. This viz lets you pick a denominator, watch digits stream out one at a time, and see the exact moment the repeating block locks in.

The three fractions side by side

Before you slide anything, stare at the raw decimal expansions for a moment. They all came out of the same algorithm — long division — and every recurring digit you see was forced by a remainder repeating itself.

\frac{1}{7} = 0.\overline{142857}
\frac{1}{11} = 0.\overline{09}
\frac{1}{13} = 0.\overline{076923}

The bar over the digits marks the block that repeats forever. \dfrac{1}{7} has a six-digit block. \dfrac{1}{11} has a tiny two-digit block. \dfrac{1}{13} has a six-digit block of its own. The ratio of block length to denominator size is not random — it is pinned down by a theorem about powers of 10 modulo q, and you can already see the theorem at work if you look carefully.

The precision slider — digits emerge one at a time

Interactive precision slider revealing the decimal expansion digit by digitA horizontal slider controlling a precision parameter from two to twenty-four decimal digits. Readouts above show the decimal expansion of one over seven, one over eleven, and one over thirteen truncated to the current precision. As the reader drags the slider to higher precisions, additional digits appear on the right end of each expansion, making the repeating block visible through repetition. precision: 1/7 = 1/11 = 1/13 = 2 13 24 ↔ drag to reveal more digits
Start the slider at $6$ digits. You will see $0.142857$, $0.090909$, $0.076923$ — exactly one period of each loop. Drag higher. At $12$ digits, $1/7$ shows $142857142857$: the block has repeated cleanly. $1/11$ shows $090909090909$: six copies of its tiny block. $1/13$ shows $076923076923$: one full cycle and a second one starting. The repetition is not approximate — it is exact, and it will keep going for as long as you keep dragging.

Why: the decimal digits are the quotient digits from long division. At each step, the remainder lives in the set \{0, 1, \ldots, q-1\} — only q possible values. If the remainder ever repeats, the digits must repeat from that point on, because the next step of long division depends only on the current remainder. With only q possible remainders, a repeat is forced within at most q-1 nonzero steps.

What makes each personality different

\dfrac{1}{7}: the maximal cycler. The block 142857 is exactly 6 digits long — the longest it could possibly be, since the remainders after each step live in \{1, 2, 3, 4, 5, 6\} and there are only six of them. A fraction with this property — period length equal to q - 1 — is called a full-reptend denominator, and 7 is the smallest example. The block has a further party trick: 142857 \times 2 = 285714, \times 3 = 428571, \times 4 = 571428. Every small multiple is a cyclic rotation of the original block. This is not a coincidence; it falls out of the structure of 10^k \bmod 7.

\dfrac{1}{11}: the short-loop denominator. The block 09 is only 2 digits. Why so short? Because 10^2 = 100 = 9 \times 11 + 1, which means 10^2 \equiv 1 \pmod{11}. The smallest k for which 10^k \equiv 1 \pmod{q} is the exact period, so 1/11 has period 2. Other denominators with short periods — 1/101 has period 4, 1/41 has period 5 — all share this property: 10 reaches 1 modulo q after only a few steps.

\dfrac{1}{13}: a second full-length twin. The block 076923 is 6 digits long again, even though 13 is bigger than 7. This means 1/13's period is only half of its maximum possible value 12. Curiously, the block 076923 and the block 142857 are not unrelated: 1/13 + 1/7 has a decimal expansion whose repeating block is obtained by a clean addition of the two blocks. And 076923 \times 2 = 153846 is also the repeating block of 2/13, just as 142857 \times 2 gave you 2/7.

The block length is a number-theory fingerprint

The length of the repeating block — the period — is the smallest positive integer k such that 10^k \equiv 1 \pmod{q}, provided q is coprime to 10. This is called the multiplicative order of 10 modulo q, and it is a fingerprint of the denominator.

You can compute the period by hand for small q just by long-dividing and counting, but the deeper fact is that the period always divides q - 1 whenever q is prime (this is a corollary of Fermat's little theorem). So for q = 7, the period must divide 6 — it ended up being exactly 6. For q = 13, the period must divide 12 — it ended up being 6, a proper divisor.

Spotting the block from the stream

A practical skill when you are long-dividing a fraction by hand: watch the remainders, not the digits. The remainders are the early-warning system. As soon as a remainder reappears, you know the block is closing and you can circle back to write the repeat sign. This is usually faster than trying to spot a pattern in the digits themselves, because the remainders are small and easier to scan.

For 1/7, the sequence of remainders (before seeing the next digit) is 1 \to 3 \to 2 \to 6 \to 4 \to 5 \to 1 \to \ldots. The moment you get back to 1, you stop.

For 1/11, it is 1 \to 10 \to 1 \to 10 \to \ldots. The remainder returns to 1 after just two steps — hence the two-digit block.

For 1/13, it is 1 \to 10 \to 9 \to 12 \to 3 \to 4 \to 1 \to \ldots. Six steps, six remainders, then back to 1.

Convert $0.\overline{142857}$ back to a fraction

You saw the decimal. Can you recover the fraction without being told it is \tfrac{1}{7}?

Let x = 0.\overline{142857}. The repeating block is 6 digits, so multiply both sides by 10^6 = 1000000:

1000000\,x = 142857.\overline{142857}

Subtract the original from this:

1000000\,x - x = 142857
999999\,x = 142857
x = \frac{142857}{999999}

The numerator and denominator share the common factor 142857, because 999999 = 7 \times 142857. Dividing top and bottom by 142857:

x = \frac{1}{7}

The trick works for every repeating decimal — see the multiply-and-subtract recipe for the full algorithm and more worked examples.

The takeaway

Try extending the precision slider above to 24 digits and compare the three expansions. You will see four full cycles of 1/7, twelve of 1/11, and four of 1/13. Three rational numbers, three loops, all produced by the same dry algorithm.

Related: Fractions and Decimals · Long Division Reveals the Repeating Block — Watch the Loop Appear · Convert a Repeating Decimal to a Fraction — the Multiply-and-Subtract Trick · Test If a Number Is Rational by Looking for Its Repeating Block · Non-Terminating vs Non-Repeating — Same Thing or Different?