# Mathematics: Fraction \> decimal = repeated number sequence

**URL:** <https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156>\
**Category:** Factual Questions\
**Created:** [August 24, 2019, 1:50pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156 "2019-08-24T13:50:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Walken\_After\_Midnight](https://avatars.discourse-cdn.com/v4/letter/w/b487fb/32.png) [@Walken\_After\_Midnight](https://boards.straightdope.com/u/Walken_After_Midnight)\
**Post date:** [August 24, 2019, 1:50pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/1 "2019-08-24T13:50:33Z")

</div>

I was dividing 100 by 27 and noticed that the resulting number was made up of a repeating sequence of numbers. Here is the result using a [Big Number Calculator](https://www.calculator.net/big-number-calculator.html) to 100 decimal places:

3.7037037037037037037037037037037037037037037037037037037037037037037037037037037037037037037037037037

I’m not very mathematically-minded, but I can understand why dividing 100 by 3 produces an infinite number of 3s (33.33333333 etc). Is what’s going on with 100 divided by 27 the same?

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 24, 2019, 2:39pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/2 "2019-08-24T14:39:05Z")

</div>

If you divide any integer by any other integer, you will always get a decimal which either terminates, or which eventually goes into a section that repeats infinitely. And really, terminating is just a special case of repeating, where the repeating part happens to be 0.

Likewise, any time you have a decimal that eventually repeats, you can find a ratio of two integers that equals it. Any such number (that repeats as a decimal, and can be the ratio of two integers) is called a “rational number”.

Some numbers (the vast majority of them, in fact) cannot be the result of dividing one integer by another, and if you express them as a decimal, the digits never repeat. These are called “irrational numbers”, and the most well-known examples are pi and the square root of 2.

---

<div class="post-metadata">

**Author:** ![Great\_Antibob](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@Great\_Antibob](https://boards.straightdope.com/u/Great_Antibob)\
**Post date:** [August 24, 2019, 2:48pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/3 "2019-08-24T14:48:07Z")

</div>

> [@Walken\_After\_Midnight](#):
>
> divided by 27

I’ll add you picked an interesting example, because 27 is 3_3_3, so absolutely it’ll exhibit many of the behaviors you see with 3.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [August 24, 2019, 3:04pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/4 "2019-08-24T15:04:21Z")

</div>

Yes, note, the expansion of a rational number eventually repeats, and conversely, but it is not necessarily the case that the entire thing repeats (for example, 1.000012345656565…)

You can start to see how this works by dividing integers by numbers of the form 99…9000…0, eg 123/999 = 0.123123…

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [August 24, 2019, 3:16pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/5 "2019-08-24T15:16:01Z")

</div>

> [@Chronos](#):
>
> If you divide any integer by any other integer, you will always get a decimal which either terminates, or which eventually goes into a section that repeats infinitely.

(To the OP: ) If you know/remember how pencil-and-paper long division works, you can see why this is true. Whenever you divide one whole number by another, eventually either you will get a remainder of 0 (so, no more decimal digits), or you’ll get a remainder you’ve gotten before, at which point you’ll start endlessly looping through the same series of digits you’ve seen before.

You can see one example of this [here](https://socratic.org/questions/why-do-rational-numbers-repeat).

---

<div class="post-metadata">

**Author:** ![Ignotus](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Ignotus](https://boards.straightdope.com/u/Ignotus)\
**Post date:** [August 24, 2019, 3:17pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/6 "2019-08-24T15:17:12Z")

</div>

> [@Chronos](#):
>
> If you divide any integer by any other integer, you will always get a decimal which either terminates, or which eventually goes into a section that repeats infinitely. And really, terminating is just a special case of repeating, where the repeating part happens to be 0.

This insight will come a lot easier if you learned to do long division in school. For any divisor n each step in the algorithm will give a remainder smaller than n. Now, there are only finitely many numbers smaller than n, so sooner or later you´ll hit upon one you’ve encountered before…!

(Darn! Ninja’d!)

---

<div class="post-metadata">

**Author:** ![Walken\_After\_Midnight](https://avatars.discourse-cdn.com/v4/letter/w/b487fb/32.png) [@Walken\_After\_Midnight](https://boards.straightdope.com/u/Walken_After_Midnight)\
**Post date:** [August 24, 2019, 3:18pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/7 "2019-08-24T15:18:12Z")

</div>

> [@Chronos](#):
>
> If you divide any integer by any other integer, you will always get a decimal which either terminates, or which eventually goes into a section that repeats infinitely. And really, terminating is just a special case of repeating, where the repeating part happens to be 0.
> 
> Likewise, any time you have a decimal that eventually repeats, you can find a ratio of two integers that equals it. Any such number (that repeats as a decimal, and can be the ratio of two integers) is called a “rational number”.
> 
> Some numbers (the vast majority of them, in fact) cannot be the result of dividing one integer by another, and if you express them as a decimal, the digits never repeat. These are called “irrational numbers”, and the most well-known examples are pi and the square root of 2.

Thanks. I just tried it out with a few numbers and can see the repeating patterns. I guess one would generally need to use a big number calculator for it to stand out. Here are some examples, with the repeated number sequences in bold:

100 ÷ 7 = **14.2857** 142857142857142857142857142857142857142857142857142857142857142857142857142857142857142857142857

100 ÷ 13 = **7.69230** 76923076923076923076923076923076923076923076923076923076923076923076923076923076923076923076923

100 ÷ 21 = **4.76190** 47619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619

100 ÷ 23 = **4.347826086956521739130** 4347826086956521739130434782608695652173913043478260869565217391304347826086956

> [@Great\_Antibob](#):
>
> I’ll add you picked an interesting example, because 27 is 3_3_3, so absolutely it’ll exhibit many of the behaviors you see with 3.

Yes, it kind of makes more sense if one calculates it step by step:

100 ÷ 3 = 33.33333333333333 _ad infinitum_

33.33333333333333 ÷ 3 = 11.11111111111111‬ _ad infinitum_

11.11111111111111‬ ÷ 3 = 3.703703703703703‬ _ad infinitum_

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [August 24, 2019, 3:42pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/8 "2019-08-24T15:42:21Z")

</div>

It all has to do with remainders, just like in grade school math.

Since it’s too hard to replicate the lines and symbols, work with me.

27 goes into 100.0000000~ \*\*three \*\*times with a remainder of 19.

27 doesn’t go into 19, so drop a 0. 27 goes into 190 \*\*seven \*\*times with a remainder of 1.

27 doesn’t go into 1, so drop a zero. 27 doesn’t go into 10, either, so that’s \*\*zero \*\*times.

After dropping another zero. 27 goes into 100 \*\*three \*\*times with a remainder of 19.

But that’s right back where we started. The pattern is fixed. No new numbers can enter. Therefore we get an infinite pattern of 370370370370~.

You can see interesting patterns even on numbers with no repetition. My favorite is 1/98. Since each division has a remainder of 2, the progression starts 0.010204081632. The next step - 0.01020408163265 - seems to screw things up. But it actually doesn’t. The 1 in 128 (twice 64) that follows overlaps with the 64 and becomes 0.0102040816326530. 30? Yes, because the 2 of the following 256 is added to the 128. The numbers get more and more squished up and it’s harder to figure out but it becomes a nice exercise in powers of two and stacked addition.

---

<div class="post-metadata">

**Author:** ![Walken\_After\_Midnight](https://avatars.discourse-cdn.com/v4/letter/w/b487fb/32.png) [@Walken\_After\_Midnight](https://boards.straightdope.com/u/Walken_After_Midnight)\
**Post date:** [August 24, 2019, 4:25pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/9 "2019-08-24T16:25:21Z")

</div>

Here’s an interesting number sequence pattern. 100 divided by 81 produces a repeating sequence of all the numbers in order except for the number 8.

100 ÷ 81 =

**1.23456790** 12345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012

If one then multiplies that number by 80 one gets all the numbers in reverse order except for the number 1.

1.2345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012

x 80 =

**98.7654320** 98765432098765432098765432098765432098765432098765432098765432098765432098765432098765432096

The ratio 81 : 80 is a [syntonic comma](https://en.wikipedia.org/wiki/Syntonic_comma) in musical frequency ratios.

---

<div class="post-metadata">

**Author:** ![Walken\_After\_Midnight](https://avatars.discourse-cdn.com/v4/letter/w/b487fb/32.png) [@Walken\_After\_Midnight](https://boards.straightdope.com/u/Walken_After_Midnight)\
**Post date:** [August 24, 2019, 4:45pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/10 "2019-08-24T16:45:52Z")

</div>

Here are the prime factors of 81 : 80

3x3x3x3 : 2x2x2x2 x 5

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [August 24, 2019, 5:13pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/11 "2019-08-24T17:13:29Z")

</div>

Note that you can get any repeating decimal you want by taking the repeating part, as an integer, and dividing by 999…999, where there are the same number of 9’s as digits in the repeating part. For example, if you want 123456790 to repeat, just take 123456790/999999999. Of course this reduces to 10/81.

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [August 24, 2019, 6:02pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/12 "2019-08-24T18:02:29Z")

</div>

What you are seeing is the very definition of rational vs. irrational numbers. A rational number is a repeating pattern and can also be expressed as a fraction of two whole numbers, using markn+'s trick.

An irrational number (ie. Pi, e, sqrt(2) ) does not have a repeating decimal expression and also cannot be expressed as a “ratio” of two numbers.

---

<div class="post-metadata">

**Author:** ![md2000](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@md2000](https://boards.straightdope.com/u/md2000)\
**Post date:** [August 24, 2019, 6:08pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/13 "2019-08-24T18:08:41Z")

</div>

For example - 1/7 is .142857… repeating. 999999/142857= 7 the opposite of creating the repeating decimal.

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [August 24, 2019, 6:31pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/14 "2019-08-24T18:31:56Z")

</div>

> [@md2000](#):
>
> What you are seeing is the very definition of rational vs. irrational numbers. A rational number is a repeating pattern and can also be expressed as a fraction of two whole numbers

In fact, that’s why they’re called “ **ratio** nal numbers”: they’re the ones that can be written as a **ratio** of two integers.

---

<div class="post-metadata">

**Author:** ![Walken\_After\_Midnight](https://avatars.discourse-cdn.com/v4/letter/w/b487fb/32.png) [@Walken\_After\_Midnight](https://boards.straightdope.com/u/Walken_After_Midnight)\
**Post date:** [August 24, 2019, 6:38pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/15 "2019-08-24T18:38:17Z")

</div>

> [@markn\_1](#):
>
> Note that you can get any repeating decimal you want by taking the repeating part, as an integer, and dividing by 999…999, where there are the same number of 9’s as digits in the repeating part. For example, if you want 123456790 to repeat, just take 123456790/999999999. Of course this reduces to 10/81.

That’s interesting.

Wikipedia’s page on the [number 81](https://en.wikipedia.org/wiki/81_(number)) mentions the recurring set of sequential numbers missing only the digit “8”, and provides an equation.

---

<div class="post-metadata">

**Author:** ![Ignotus](https://avatars.discourse-cdn.com/v4/letter/i/ecc23a/32.png) [@Ignotus](https://boards.straightdope.com/u/Ignotus)\
**Post date:** [August 24, 2019, 7:08pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/16 "2019-08-24T19:08:51Z")

</div>

> [@markn\_1](#):
>
> **Note that you can get any repeating decimal you want** by taking the repeating part, as an integer, and dividing by 999…999, where there are the same number of 9’s as digits in the repeating part. For example, if you want 123456790 to repeat, just take 123456790/999999999. Of course this reduces to 10/81.

Well, except for those ending in a repeated 9. If you try, you’ll come up with a number ending in zeroes instead. Actually, those are just different representations of the same number. I believe there might be a thread about this somewhere… 😉

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [August 24, 2019, 7:38pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/17 "2019-08-24T19:38:23Z")

</div>

> [@Thudlow\_Boink](#):
>
> (To the OP: ) If you know/remember how pencil-and-paper long division works, you can see why this is true. Whenever you divide one whole number by another, eventually either you will get a remainder of 0 (so, no more decimal digits), or you’ll get a remainder you’ve gotten before, at which point you’ll start endlessly looping through the same series of digits you’ve seen before.

It’s also easy to see why the repeating sequence can have a maximum length of the divisor minus 1. There are D possible remainders: 0, 1… D-1. But as you say, we stop at a 0, so for the remaining set there are D-1 possibilities. The longest repetition represents some permutation of this set. 1/7 is a good example; the repeating set is 6 long: 0.(142857)(142857)(142857)…

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 24, 2019, 7:44pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/18 "2019-08-24T19:44:39Z")

</div>

The sevenths are especially fun.

```auto

1/7 = 0.142857142857142857...
2/7 = 0.285714285714285714...
3/7 = 0.428571428571428571...
4/7 = 0.571428571428571428...
5/7 = 0.714285714285714285...
6/7 = 0.857142857142857142...

```

---

<div class="post-metadata">

**Author:** ![Dr.Strangelove](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/dr.strangelove/32/6613_2.png) [@Dr.Strangelove](https://boards.straightdope.com/u/Dr.Strangelove)\
**Post date:** [August 24, 2019, 8:22pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/19 "2019-08-24T20:22:58Z")

</div>

All of the max-length repeating denominators ([called full reptend primes](https://en.wikipedia.org/wiki/Full_reptend_prime)) will do that. The next smallest one is 17:

```auto

0.05882352941176470588235294117647
          0.11764705882352941176470588235294
           0.17647058823529411764705882352941
    0.23529411764705882352941176470588
       0.29411764705882352941176470588235
     0.35294117647058823529411764705882
         0.41176470588235294117647058823529
              0.47058823529411764705882352941176
      0.52941176470588235294117647058824
 0.58823529411764705882352941176471
             0.64705882352941176470588235294118
               0.70588235294117647058823529411765
            0.76470588235294117647058823529412
   0.82352941176470588235294117647059
  0.88235294117647058823529411764706
        0.94117647058823529411764705882353

```

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [August 24, 2019, 9:11pm UTC](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156/20 "2019-08-24T21:11:59Z")

</div>

An OP that mentions that

1/27 = 0.037037037 …

but no one points out that

1/37 = 0.027027027 … ?

Charles Fleischer is not going to be happy when he hears this.

[Moleeds](https://www.ted.com/talks/charles_fleischer_insists_all_things_are_moleeds?language=en#t-846206). (If you don’t want to watch the whole thing, jump to about 3:50 left.)

[Next page](https://boards.straightdope.com/t/mathematics-fraction-decimal-repeated-number-sequence/839156.md?page=2)
