A diagram showing the cyclic number 142857 repeating infinitely via a circular representation

A while back, I wrote an essay on the curious case of the interesting number paradox. While concluding this essay, I requested readers to share their favourite number(s). I got a few interesting entries in the comments section. Out of the whole lot, Fabiano Fagundes’s comment took the cake for me:

“Mine is 142857. No kidding. I love the only cyclic number in the decimal system.”

Until this point, I did not know about this number. So, naturally, I had to investigate. The deeper I dove in, the more interesting this number got. So, here we are.

I will start by sharing some of the interesting properties of this number. Following this, I will explain why this number is a cyclic number. Finally, I will touch upon the generalised notion of cyclic numbers. If you are interested in this sort of stuff, strap in, and let us begin.

The Mathematical Carousel

Let us start with the number in question: 142857

To begin, let me just arrange the digits that constitute this number in their ascending order as follows (note that we have 6 digits in total):

1, 2, 4, 5, 7, 8

Now, let us go back to the original number and multiply it by 1:

142857 * 1 = 142857

There are no surprises here. Any number multiplied by unity results in the same number. But just to make sense of the results that will shortly follow, note that this result starts with the smallest digit among the six digits (1).

Next, let us multiply the original number by 2:

142857 * 2 = 285714

This looks like a trivial result at first glance. But when you look closer, you might realise that this result is just a permutation of the number 142857 that starts with the second smallest digit among all the six digits.

Let us keep going. What happens if we multiply 142857 by 3?

142857 * 3 = 428571

We just ended up with another permutation of 142857. But this time, the cycle starts from the third smallest number (4). By this point, you should be able to predict what happens when we continue:

142857 * 4 = 571428 (starts with the fourth smallest digit (5))

142857 * 5 = 714285 (starts with the fifth smallest digit (7))

142857 * 6 = 857142 (starts with the sixth smallest digit (8))

Properties of the cyclic number: 142857 * 1 = 142857 (starts with the smallest digit (1))
 142857 * 2 = 285714 (starts with the second smallest digit (2))
 142857 * 3 = 428571 (starts with the third smallest digit (4))
 142857 * 4 = 571428 (starts with the fourth smallest digit (5))
 142857 * 5 = 714285 (starts with the fifth smallest digit (7))
 142857 * 6 = 857142 (starts with the sixth smallest digit (8))
Properties of the cyclic number — Math illustrated by the author

So, in essence, 142857 is an integer which results in cyclic permutations of its digits when multiplied by integers 1 through 6. What happens if we multiply it by 7, though? Let us find out.

What is so Special about 7?

142857 * 7 = 999999

That is interesting. This time, we don’t get cyclic repetition, but in turn, we get ‘9’ repeated 6 times. This result is closely related to why 142857 is a cyclic number in the first place. We will get there in a bit. But first, I will show you a few more interesting properties of this number that are related to this result.

This essay is supported by Generatebg

A product with a beautiful background featuring the sponsor: Generatebg - a service that generates high-resolution backgrounds in just one click. The description says "No more costly photographers" and displays a "Get Started" button beneath the description.

Let us take the number 142857, break it up into two 3-digit numbers, and add them as follows:

142 + 857 = 999

How fascinating?! When we break the 6-digit number into two 3-digit numbers and add them, we get ‘9’ repeating 3 times.

What if we split 142857 into three 2-digit numbers and add them like so:

14 + 28 + 57 = 99

This time, we get ‘9’ repeating twice.

What if we cyclically break down 142857 into three 4-digit numbers and add them?

1428 + 5714 + 2857 = 9999

We get ‘9’ repeating 4 times. In case you are wondering why we added the 4-digit numbers thrice, we did this so that each digit was used the same number of times (in the previous two cases, each digit was used just once).

Now that we have seen the special case with 7, you might wonder what happens with numbers beyond 7. Let us address that question next.

The Fancy Merry-go-round Continues

Let us multiply 142857 by 8:

142857 * 8 = 1142856

This might also appear to be a trivial result at first glance. But if we take the last 6 digits and add the resulting number to the remaining digit(s), we will arrive at the following result:

1 + 142856 = 142857 (the cyclic number starting with the smallest digit)

We could keep going with the same approach:

142857 * 9 = 1285713

→ 1 + 285713 = 285714 (the cyclic number starting with the second smallest digit)

142857 * 10 = 1428570

→ 1 + 428570 = 428571 (the cyclic number starting with the third smallest digit)

And so on.

Just like before, something different happens when we multiply 142857 by 14:

142857 * 14 = 1999998

→ 1 + 999998 = 999999

What is so special about 14? That’s right — it is a multiple of 7!

A diagram showing the cyclic number 142857 repeating infinitely via a circular representation
The cyclic number — Illustrative art created by the author

Now that we have covered some of the interesting properties of the cyclic number 142857, let us see why this number is cyclic in the first place.

The Mathematical Origin

So far, we have established the cyclic nature of 142857 when multiplied by 1 through 6 and that something different happens when multiplied by 7. I also said that the result with 7 is closely related to why this number is cyclic. Now is the time to unravel the underlying reason.

Let us start by computing 1 divided by 7:

1/7 = 0.142857142857… (the first smallest digit appears after the decimal point)

That’s right. The fraction repeats our cyclic number infinitely after the decimal point. Next, let us multiply this by 10:

10/7 = 1.42857142857…

We can convert 10/7 into a mixed fraction as follows:

10/7 = 1 + 3/7 = 1.42857142857…

Subtracting 1 from both sides:

3/7 = 0.42857142857… (the third smallest digit appears after the decimal point)

That’s an interesting result, right? But let us keep going by multiplying this result by 10:

30/7 = 4.2857142857…

We can convert 30/7 into a mixed fraction as follows:

30/7 = 4 + 2/7 = 4.2857142857…

Subtracting 4 from both sides:

2/7 = 0.2857142857… (the second smallest digit appears after the decimal point)

Just to drive this point home, let me illustrate what happens when we multiply the above result by 10:

20/7 = 2.857142857…

20/7 can be expressed as a mixed fraction as follows:

20/7 = 2 + 6/7 = 2.857142857…

Subtracting 2 from both sides:

6/7 = 0.857142857… (the sixth smallest digit appears after the decimal point)

You could keep going by multiplying the above result by 10, and so on.

But in essence, the reason why 142857 is a cyclic number is the nature of fractions with 7 as the denominator. You can also look at this the other way around:

1/142857 = 0.000007000007…

If you are still wondering if 7 is special, it is not.

The Generalised Condition for a Cyclic Number

142857 just happens to be the first cyclic number. The next one is:

0588235294117647

This number has 16 digits and arises from the fraction 1/17 = 0.0588235294117647. Multiplication with 1 through 16 results in cyclic permutations, whereas multiplication with 17 results in ‘9’ repeating 16 times.

Now, what do 7 and 17 have in common? They are both prime numbers.

Let P be a prime number and X be an arbitrary cyclic number with an arbitrary number of digits

Cyclic numbers arise from primes with the following form (let this be Equation 1):

Equation 1: 1/P = 0.XXXX…
Equation 1 — Math illustrated by the author

As you can see the cyclic number repeats itself infinitely after the decimal point. When we multiply both sides with 10^(P-1), we get the following (Equation 2):

Equation 2: [10^(P-1)]/P = X.XXX…
Equation 2 — Math illustrated by the author

Subtracting Equation 1 from Equation 2, we get:

General expression for a cyclic number: X = ([10^(P-1)] — 1)/P
General expression for a cyclic number — Math illustrated by the author

This is the formal expression/condition for cyclic numbers. Note that when you multiply the right-hand side with P, you would end up with 9 repeating (P-1) times. That is where the special results come from.

However, there is a catch: not all primes apply to this condition/expression! The applicable primes are called Full Reptend Primes and you can find a complete list of these here. As of now, we have no known algorithm to compute full reptend primes.

Similarly, you can find a list of all cyclic numbers here. But note that all numbers following 142857 must be considered with a leading zero. To figure out why, let us go back to Fabiano Fagundes’s original comment:

“Mine is 142857. No kidding. I love the only cyclic number in the decimal system.”

Note that he refers to 142857 being the ONLY cyclic number in the decimal system. The reason for this is that if we do not allow for numbers with a leading zero, 142857 is indeed the only cyclic number there is (in the decimal system). Contrary to what I said earlier, this fact makes the number 7 special after all.

And with that, I conclude this essay and hope that you enjoyed reading it.


If you’d d like to get notified when interesting content gets published here, consider subscribing.

Further reading that might interest you: 

If you would like to support me as an author, consider contributing on Patreon


References and credit: Dr. Tony Padilla/NumberphileEric W. Weisstein, and Santanu Bandyopadhyay.

Street Science

Explore humanity's most curious questions!

Sign up to receive more of our awesome content in your inbox!

Select your update frequency:

We don’t spam! Read our privacy policy for more info.