On this page
Double 142857 and you get 285714; triple it and you get 428571. The same six digits come back in the same circular order, starting from a different place. It falls out of long division by 7, and the same idea predicts which other numbers do it.
What is a cyclic number?
A cyclic number is an integer whose cyclic permutations (rotations of its digits) are successive multiples of the number, as defined in Wikipedia's article on cyclic numbers. Without leading zeros, 142857 is the only one in base 10, the article notes. Its first six multiples:
142857 × 1 = 142857
142857 × 2 = 285714
142857 × 3 = 428571
142857 × 4 = 571428
142857 × 5 = 714285
142857 × 6 = 857142
The seventh multiple breaks the pattern: 142857 × 7 = 999999, as the same article shows. MathWorld's entry on cyclic numbers gives the general rule: a cyclic number multiplied by its generating prime is a string of 9s.
Why do the multiples of 142857 rotate?
Long-divide 1 by 7 (MathWorld gives 1/7 = 0.142857…) and watch the remainders, not the digits.
10 ÷ 7 = 1, remainder 3
30 ÷ 7 = 4, remainder 2
20 ÷ 7 = 2, remainder 6
60 ÷ 7 = 8, remainder 4
40 ÷ 7 = 5, remainder 5
50 ÷ 7 = 7, remainder 1, and we are back where we began
The remainders run through 3, 2, 6, 4, 5, 1: every non-zero remainder mod 7, once each. Dividing 3 by 7 is the same as joining this division where the remainder is 3, just after the first digit. So 3/7 = 0.428571…, the same cycle read from the second digit, and 142857 × 3 = 428571. The same holds for 2/7, 4/7, 5/7 and 6/7, because each numerator appears in the remainder list.
And 7/7 = 1 = 0.999999…, which is why 142857 × 7 = 999999.
Which primes give cyclic numbers?
The remainders above are the powers of 10 mod 7: 10 leaves 3, 100 leaves 2, 1000 leaves 6, and so on until 10^6 leaves 1. When the powers of 10 reach every non-zero remainder before repeating, 10 is called a primitive root modulo that prime. Since 10 leaves remainder 3, the list is the same as the powers of 3 mod 7, which our post on primitive roots modulo a prime works through.
The primes for which 10 is a primitive root are called full reptend primes, and the decimal of 1/p for them has period p − 1, the longest possible, according to OEIS sequence A001913. The same entry lists them (7, 17, 19, 23, 29, 47, 59, 61, 97, …) and gives the cyclic numbers as (10^(p−1) − 1)/p. For p = 7 that is 999999/7 = 142857.
The period can never exceed p − 1, because there are only p − 1 non-zero remainders. Our post on Lagrange's theorem and Fermat explains why the period always divides p − 1.
A useful contrast: 1/13 = 0.076923… repeats after only six digits, not twelve, as shown on Wikipedia's Midy's theorem page. So 13 is not a full reptend prime, and 076923 is not cyclic: 076923 × 2 = 153846, which uses different digits.
Why does 142 + 857 = 999?
Split 142857 in half and add: 142 + 857 = 999. This is Midy's theorem, after the French mathematician E. Midy (1836), as stated on Wikipedia's Midy's theorem page. For a fraction a/p with p prime and an even period, the second half of the repeating block is the 9s complement of the first half, so the halves add to a string of 9s. The same page gives 076 + 923 = 999 for 1/13 and 05882352 + 94117647 = 99999999 for 1/17.
The reason is in the remainders: halfway through 1/7 the remainder is 6, which is 7 − 1. From there, wherever the first half had remainder r, the second half has 7 − r, and that turns each digit d into 9 − d. Thirds work too: 14 + 28 + 57 = 99, as Wikipedia's cyclic number article shows.
How can you check this yourself in ten minutes?
Try this on paper:
Long-divide 1 by 17 and write the remainder at every step.
Count how many steps pass before remainder 1 returns. If it is 16, 17 is a full reptend prime.
Take the 16-digit block, split it in half and add the halves. Expect 99999999.
Repeat for 13 and note where the remainders stop short of all twelve values.
Explain to someone else, in two sentences, why 3/7 starts with 4.
If step 5 is hard, the gap is usually the link between remainders and starting points. The Fermi Concept Library covers every concept in mathematics, each with its own lesson. For the division itself, read our guide to telling a terminating decimal from a repeating one.



