Repeated decimal.

Proof that 1/7 is a repeated decimal

This blog post serves as an exercise and solution to the following question:


In plain English: is the fraction \frac{1}{7} a repeated decimal (0.142857142857142857…)?

Recurring pattern

How can we tackle such a problem? First note that we have to deal with a recurring pattern: a pattern that refers to itself. One useful concept to model such problems is the concept of sequences. We can model the repeated decimal by the following sequence:

0.\overline{142857}=x_n x_{n+1}=0.142857 + 10^{-6} x_n

With x_0=0

Are you interested in learning more Python? Order our new "Mastering Pandas" course now on Data Blogger Courses for only €39.99 €28.10! You will:
  • Learn to visualize data using Pandas
  • Learn how to load and store data effectively
  • Learn advanced data operations
For the price of only three pizzas, you will join our Data Blogger community, so don't miss out and make sure to get your copy now.

How does that work? How does this sequence approximate the repeated fraction? First, take a look at x_1. x_1=0.142857+10^{-6}\cdot x_0=0.142857. Now, take a look at the following item in the sequence: x_2=0.142857+10^{-6}\cdot x_1=0.142857142857. So, it concatenates “142857” and the recurring pattern constructed so far. By that property we know that the sequence x_n equals the repeated decimal if n approaches \infty.

The proof

We would like to proof that \frac{1}{7}=0.\overline{142857}. This is equal to proving that 1=7 \cdot 0.\overline{142857}. This equals 1 - 7 \cdot 0.\overline{142857} and this is equal to proving that 1 - 7 \cdot \lim\limits_{n \rightarrow \infty} x_n = 0.

Another sequence

Lets introduce another sequence:

a_n = 1 - 7 \cdot x_n

Notice that the statement we need to proof is the same as the following:

1 - 7 \cdot \lim\limits_{n \rightarrow \infty} x_n = 0 \iff \lim\limits_{n \rightarrow \infty} a_n

Now notice that:

a_{n+1}=1-7 \cdot x_{n+1}=1 - 7 \cdot (x_n \cdot 10^{-6} + 0.142857) a_{n+1}=1 - 10^{-6} \cdot 7 \cdot x_n - 0.999999 a_{n+1}=0.000001 - 10^{-6}\cdot 7 \cdot x_n a_{n+1}=10^{-6}\cdot(1 - 7 \cdot x_n)


a_{n+1}=10^{-6} \cdot a_n

And thus we know that:

a_{n+k}=10^{-6k} \cdot a_n

Thus (for n = 0):

a_k=10^{-6k} \cdot a_0

From this, we get that:

\lim\limits_{k \rightarrow \infty} a_k = a_0 \cdot \lim\limits_{k \rightarrow \infty} 10^{-6k} = 0

And from this we can deduce the earlier statement, thus:


Thus, \frac{1}{7} is indeed equal to the repeated fraction 0.\overline{142857}! If you have any questions or suggestions, feel free to post them below!

Help building the Data Blogger Community

Help to grow our community to spread AI and Data Science education around the globe.
Every penny counts.

Kevin Jacobs

I'm Kevin, a Data Scientist, PhD student in NLP and Law and blog writer for Data Blogger. You can reach me via Twitter (@kmjjacobs) or LinkedIn.