Video 3, chapter 3

142857, the Number That Rotates

Why the cyclic number 142857 keeps its six digits in the same circular order when multiplied by 1 to 6, explained by the long division of 1 by 7, its remainder cycle and the period of a repeating decimal.

  • Video 3, chapter 3
  • Numbers with a hidden mechanism

Multiply 142857142857 by 22 and you get 285714285714, the same six digits in the same circular order, read from a different starting point. Multiplying by 33, 44, 55 and 66 does the same, and multiplying by 77 gives 999999999999. Why would multiplication only move the starting point around a circle? This page follows the long division of 11 by 77, shows that its remainders run through a loop of all six nonzero values, and explains how that loop produces the rotations and why many repeating decimals do not behave this way.

Key terms

Cyclic number

Definition A cyclic number is a positive whole number, written with nn digits for some n≥2n \ge 2 (a leading zero is allowed), such that multiplying it by each of 1,2,…,n1, 2, \ldots, n gives a product whose nn digits are a rotation of its own digits. A rotation keeps the digits in the same circular order and starts reading them at another place, as 142857142857 read from the 22 gives 285714285714. The number 142857142857 is a cyclic number with six digits, and its seventh multiple is 7⋅142857=9999997 \cdot 142857 = 999999, which is not a rotation. The explanation is that 142857142857 is the repeating block of 1/7=0.142857142857…1/7 = 0.142857142857\ldots, and for k=1,…,6k = 1, \ldots, 6 the product k⋅142857k \cdot 142857 is the repeating block of k/7k/7. The long division of each k/7k/7 runs around the same loop of remainders as the division of 11 by 77, entering it at remainder kk, so every block is the same six digits read from a different place.

In plain words Put the six digits of 142857142857 on a circle. Multiplying by any of 11 to 66 only changes where you start reading, because the products are the repeating blocks of 1/71/7 through 6/76/7, and all six blocks come from one loop of long division.

Example The table lists each product and the digit of the circle where its reading starts.

MultiplierProductReading starts at
1114285714285711
2228571428571422
3342857142857144
4457142857142855
5571428571428577
6685714285714288
77999999999999not a rotation

Beyond 77 the products have seven digits, for example 8⋅142857=11428568 \cdot 142857 = 1142856, so the rotations belong to the multipliers 11 to 66 only.

Long division

Definition Long division finds the decimal digits of a fraction p/qp/q, with whole numbers 0<p<q0 < p < q, one digit at a time. The first remainder is r=pr = p. At each step, ten times the current remainder is divided by qq, which gives a quotient DD and a new remainder r′r' with

10r=qD+r′,0≤r′<q.\begin{gathered} 10r = qD + r', \\[0.4em] 0 \le r' < q. \end{gathered}

The quotient DD is the next decimal digit, and it is a whole number from 00 to 99 because 10r<10q10r < 10q. The new remainder r′r' starts the next step. If a remainder is 00, every later digit is 00 and the decimal ends.

In plain words Each step asks how many times qq fits into ten times what is left over. The answer is the next digit, and whatever is left over again is carried into the next step.

Example For 1/71/7 the six steps are

RemainderTen times itDigitNew remainder
1110=7⋅1+310 = 7 \cdot 1 + 31133
3330=7⋅4+230 = 7 \cdot 4 + 24422
2220=7⋅2+620 = 7 \cdot 2 + 62266
6660=7⋅8+460 = 7 \cdot 8 + 48844
4440=7⋅5+540 = 7 \cdot 5 + 55555
5550=7⋅7+150 = 7 \cdot 7 + 17711

The digits come out in the order 1,4,2,8,5,71, 4, 2, 8, 5, 7, and the last new remainder is 11, the remainder the division started with. So the same six steps happen again and again, and

17=0.142857 142857…\frac{1}{7} = 0.142857\,142857\ldots

Remainder cycle

Definition In the long division of pp by qq, with 0<p<q0 < p < q, each remainder is one of the whole numbers 0,1,…,q−10, 1, \ldots, q - 1, and it alone decides the next digit and the next remainder. There are only qq possible remainders, so among the first q+1q + 1 remainders some value appears twice, and from its first appearance on, the same remainders and digits repeat forever in the same order. That repeating loop of remainders is the remainder cycle. When qq has no factor 22 or 55, two different remainders never lead to the same next remainder and no remainder is ever 00, so the loop closes at the starting remainder pp and the decimal repeats from its first digit. Two fractions with denominator qq whose starting remainders lie on the same cycle have repeating blocks that are rotations of each other.

In plain words The remainder is the entire memory of a long division. When an old remainder comes back, the division has no choice but to repeat everything that followed it the first time.

Example For 1/71/7 the remainders run

1→3→2→6→4→5→1,\begin{aligned} &1 \to 3 \to 2 \to 6 \\[0.4em] &\quad \to 4 \to 5 \to 1, \end{aligned}

a loop through all six nonzero remainders below 77. The division of 33 by 77 starts at remainder 33, which is already on this loop, so it produces the digits that followed remainder 33 in the division of 11 by 77,

37=0.428571 428571…\frac{3}{7} = 0.428571\,428571\ldots

That block is 3⋅142857=4285713 \cdot 142857 = 428571. Every k/7k/7 with kk from 11 to 66 starts somewhere on the same loop, which is why all six blocks are rotations of 142857142857.

Period of a repeating decimal

Definition A decimal repeats if, from some digit on, one block of digits repeats forever, and its period is the number of digits in the shortest such block. A bar over the block marks it, as in 1/7=0.142857‾1/7 = 0.\overline{142857}, which has period 66. The decimal of every fraction of whole numbers either ends or repeats. Let p/qp/q be a fraction in lowest terms with 0<p<q0 < p < q, where qq has no factor 22 or 55. Then the decimal repeats from the first digit after the point, and its period is the smallest whole number k≥1k \ge 1 for which qq divides 10k−110^k - 1. With the block written as a kk-digit whole number BB, leading zeros included,

pq=B10k−1.\frac{p}{q} = \frac{B}{10^k - 1}.

The period is at most q−1q - 1, because the loop holds only nonzero remainders, and it equals q−1q - 1 only when qq is a prime.

In plain words The period counts how many digits pass before the decimal starts over. Multiplying by 10k10^k moves one whole block in front of the decimal point, and subtracting the original number removes the endless tail.

Example Let x=0.142857‾x = 0.\overline{142857}. Moving the point six places gives

106x=142857.142857‾,106x−x=142857,\begin{aligned} 10^6 x &= 142857.\overline{142857}, \\[0.4em] 10^6 x - x &= 142857, \end{aligned}

so 999999x=142857999999x = 142857 and x=142857/999999=1/7x = 142857/999999 = 1/7. None of 99, 9999, 999999, 99999999 and 9999999999 is divisible by 77, while 999999=7⋅142857999999 = 7 \cdot 142857, so the period of 1/71/7 is 6=7−16 = 7 - 1, the largest possible for the denominator 77. Many denominators fall short of the largest possible period. The decimal 1/3=0.3‾1/3 = 0.\overline{3} has period 11, the decimal 1/11=0.09‾1/11 = 0.\overline{09} has period 22, and the decimal 1/13=0.076923‾1/13 = 0.\overline{076923} has period 66, half of the largest possible 1212.

Check yourself

  1. Use the remainder loop of 1/71/7 to write 5/75/7 as a decimal without dividing again, and compare the result with 5⋅1428575 \cdot 142857.
Show the answer

The division of 55 by 77 starts at remainder 55. In the division of 11 by 77, remainder 55 produced the digit 77, since 50=7⋅7+150 = 7 \cdot 7 + 1, and led back to remainder 11, after which the digits were 1,4,2,8,51, 4, 2, 8, 5. So

57=0.714285‾,\frac{5}{7} = 0.\overline{714285},

and indeed 5⋅142857=7142855 \cdot 142857 = 714285, the six digits of 142857142857 read from the 77.

  1. Change the denominator to 1313. The long division gives 1/13=0.076923‾1/13 = 0.\overline{076923}. Is 076923076923 a cyclic number?
Show the answer

No. The remainders of 1/131/13 run 1,10,9,12,3,41, 10, 9, 12, 3, 4 and then return to 11, so this loop holds only six of the twelve nonzero remainders. The product 2⋅076923=1538462 \cdot 076923 = 153846 is not a rotation of 076923076923, so the number fails already at the multiplier 22. The division of 22 by 1313 starts at remainder 22, which lies on a second loop 2,7,5,11,6,82, 7, 5, 11, 6, 8, and it gives 2/13=0.153846‾2/13 = 0.\overline{153846}.

All twelve multipliers follow the same pattern. Multiplying 076923076923 by 11, 33, 44, 99, 1010 or 1212, the remainders on the first loop, gives rotations of 076923076923, while multiplying by 22, 55, 66, 77, 88 or 1111 gives rotations of 153846153846, and 13⋅076923=99999913 \cdot 076923 = 999999. In general, for a denominator qq with no factor 22 or 55, a multiple m⋅Bm \cdot B of the block BB of 1/q1/q, with mm from 11 to q−1q - 1, is a rotation of BB exactly when the remainder mm lies on the loop of 11. Every multiplier from 11 to q−1q - 1 gives a rotation only when that loop contains every nonzero remainder, which happens for 77 but not for 1313.

  1. Extend the pattern to 1717. The long division of 11 by 1717 has period 1616 and the block 05882352941176470588235294117647. What should happen when this block is multiplied by 22 to 1616, and by 1717?
Show the answer

A period of 1616 means that the remainder loop of 1/171/17 holds 1616 different remainders. The only nonzero remainders below 1717 are 11 to 1616, so the loop contains all of them. Each k/17k/17 with kk from 11 to 1616 therefore enters the same loop, and its block is a rotation of 05882352941176470588235294117647.

Write BB for this block. Then k/17=kB/(1016−1)k/17 = kB/(10^{16} - 1), and kBkB is less than 1016−110^{16} - 1 for k≤16k \le 16, so kBkB, written with 1616 digits, is exactly the block of k/17k/17. Every product from 2B2B to 16B16B is therefore a rotation of BB. For example, 2B=11764705882352942B = 1176470588235294, which is BB read from its first 11. Multiplying by 1717 gives

17B=1016−1,17B = 10^{16} - 1,

which is written as sixteen nines. So 05882352941176470588235294117647 is a cyclic number with 1616 digits, as long as its leading zero is kept. The same reasoning works for every prime qq for which 1/q1/q has period q−1q - 1, such as 77, 1717, 1919 and 2323.