Mathematics: Fraction > decimal = repeated number sequence

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 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?

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.

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

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…

(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.

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!)

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.2857142857142857142857142857142857142857142857142857142857142857142857142857142857142857142857142857

100 ÷ 13 = 7.6923076923076923076923076923076923076923076923076923076923076923076923076923076923076923076923076923

100 ÷ 21 = 4.7619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619047619

100 ÷ 23 = 4.3478260869565217391304347826086956521739130434782608695652173913043478260869565217391304347826086956

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

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.

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.2345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012345679012

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.765432098765432098765432098765432098765432098765432098765432098765432098765432098765432098765432096

The ratio 81 : 80 is a syntonic comma in musical frequency ratios.

Here are the prime factors of 81 : 80

3x3x3x3 : 2x2x2x2 x 5

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.

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.

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

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

That’s interesting.

Wikipedia’s page on the number 81 mentions the recurring set of sequential numbers missing only the digit “8”, and provides an equation.

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… :wink:

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)…

The sevenths are especially fun.


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

All of the max-length repeating denominators (called full reptend primes) will do that. The next smallest one is 17:


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

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. (If you don’t want to watch the whole thing, jump to about 3:50 left.)