Patterns in Fractions
I decided to cover patterns in certain repeating decimals on this site because I felt that this is something that is not covered enough elsewhere on the Internet.
Powers of a certain number
If you take the reciprocal of (10n - k) (where n and k are integers), the powers of k taken n digits at a time appear. Here are some examples:
1/998 = 0.001 002 004 008 016 032 064 128 256 513 026 052 104 208 416 833 667 334 ...
1/9997 = 0.0001 0003 0009 0027 0081 0243 0729 2187 6562 9688 9066 7200 1600 4801 ...
1/99993 = 0.00001 00007 00049 00343 02401 16808 17657 23600 65204
And even 1/99 = 0.01010101010101..., or 1/999 = 0.001001001001..., would fit into this pattern since a number of only nines is a power of 10 minus 1, so the pattern is the powers of 1.
At a certain point, however, the pattern will break down, but other very similar patterns will crop up at later points in the fraction. In 1/998, as you can see above, the pattern eventually breaks down, but then another pattern (the numbers of the form 13*2n) appears. For another example of this, look at the decimal expansion of 1/97 (which starts off as the powers of 3 taken 2 digits at a time):
0.01 03 09 27 83 50 51 54 63 91 75 25 77 31 95 87 62 88 65 97 93 81 44 32 98 96 90 72 16 49 48 45 36 08 24 74 22 68 04 12 37 11 34 02 06 18 55 67 01 03 09 27 83 50...
As you can see, the pattern starts off with the powers of 3 taken 2 digits at a time, but eventually changes to the numbers of the form 5*3n taken 2 digits at a time, and then it changes to the numbers of the form 99 - 3n, and finally to the numbers 4*3n, and 2*3n, before it repeats.
1/96 would be the powers of 4 taken 2 digits at a time, but the pattern breaks down and it turns into all sixes:
0.01 04 16 66 66 66 66 66 66 66 66 66 66 66...
And even 1/8 would fit into this pattern because 8 is 10 - 2, but it becomes many nines, and the 4 becomes 5:
0.1
0.02
0.004
0.0008
0.00016
0.000032
0.0000064
...
0.12499999... = 0.125
1/7 = 0.142857142857142857142857142857142857142857142857142857142857142857142857...
The fraction above may not look interesting unless you look at it 2 digits at a time: the first block of 2 digits is 14, the second is 28 (2*14), and the third is 57 which is 2*28 + 1. Indeed, the infinite sum of 0.14 + 0.0028 + 0.000056 + 0.00000112 + 0.0000000224 + ... = 1/7. And in fact, 1/72 or 1/49 has all the powers of 2 taken 2 digits at a time:
1/49 = 0.02 04 08 16 32 65 30 61 22 44 89 79 59 18 36 73 46 93 87 75 51 02 04 08 16 32 65 30 61 22 44 89 79 59 18 36 73...
This happens because 2*49 = 98 = 100 - 2.
A similar thing happens with 1/127:
1/127 = 0.007874 015748 031496 062992 125984 251968 503937 007874 015748 031496 062992 125984...
This fraction may not look interesting unless you look at it 6 digits at a time: each block of 6 digits is twice the one before it. And it turns out that this is very similar to 1/7 because the number 7874 is itself equal to 127*62.
1/1272 = 1/16129 = 0.000062 000124 000248 000496 000992 001984 003968 007936 015872 031744 063488 126976 253952 507905 015810 031620 063240 126480 252960 ...
This occurs because 16129*62 = 999998 = 1000000 - 2.
And a similar pattern even happens in 1/19:
0.05263 15789 47368 42105 26315 78947 36842 10526 31578 94736 84210 ...
The first block, 05263, multiplied by 19 is 99997, so every block of five digits is 3 times the one before it. And this is actually very similar to the two fractions above because 5263 is itself equal to 19*277.
1/192 = 1/361 = 0.00277 00831 02493 07479 22437 67313 01939 05817 17451 52354 ...
n-th powers and triangular numbers
We now know that it is possible to get the powers of a certain number in a fraction, but what about the inverse, the power sequences with a fixed exponent? It turns out that this is possible. If you take the reciprocal of the square of a number with N nines, you get all integers taken N digits at a time:
1/81 = 0.012345679012345679012345679012345...
1/9801 = 0.00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 99 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21...
1/998001 = 0.001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041...
The pattern eventually breaks down though, and the missing number in all cases is the second last N-digit number. And if you take that number and multiply it by the original fraction, you get the integers backwards, except 1:
8/81 = 0.098765432098765432098765432...
98/9801 = 0.00 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44...
998/998001 = 0.000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960...
If you take the reciprocal of a cube of 10N - 1, you will get the triangular numbers (the numbers of the form 1 + 2 + 3 + ... + n) taken N digits at a time:
1/729 = 0.0013717421124828532235939643347050754458161865569272976680384087791495198902606310013717421124...
1/970299 = 0.00 00 01 03 06 10 15 21 28 36 45 55 66 78 92 06 21 37 54 72 92 12 33 55 79 03 28 54 82 10 39...
1/997002999 = 0.000 000 001 003 006 010 015 021 028 036 045 055 066 078 091 105 120 136 153 171 190 210 231 253 276 300 325 351 378 406 435 465 496 528 561 595 630 ...
It turns out that this is not the only pattern you can get with a denominator of the form (10n - 1)3. In fact, you can get the squares as well:
11/729 = 0.015089163237...
101/970299 = 0.00 01 04 09 16 25 36 49 64 82 01 22 45 70 98 27 58 92 27 61
1001/997002999 = 0.000 001 004 009 016 025 036 049 064 081 100 121 144 169 196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 962 025 090 157 ...
If you take the reciprocal of the 4th power of 10N - 1, you will get the sums of triangular numbers taken N digits at a time:
1/6561 = 0.00015241579027587258039932937052278616... (The real pattern in this fraction is actually 12345679n + 2895900, the original pattern breaks very quickly)
1/96059601 = 0.00 00 00 01 04 10 20 35 56 85 21 67 22 89 68 60...
1/996005996001 = 0.000 000 000 001 004 010 020 035 056 085 120 165 220 286 364 455 ...
And if you multiply 1/(10N - 1)4 by 102N + 4*10N + 1, you will get all the cubes:
10401/96059601 = 3467/32019867 = 0.00 01 08 27 65 27 19 48 19 39 13 48 50 24 ...
1004001/996005996001 = 334667/332001998667 = 0.000 001 008 027 064 125 216 343 512 730 001 332 730 199 747 379 100 918...
100040001/9996000599960001 = 33346667/3332000199986667 = 0.0000 0001 0008 0027 0064 0125 0216 0343 0512 0729 1000 1331 1728 2197 2744 3375 4096 4913 5832 ...
Below are fractions with the larger power sequences.
1001100110001/99950009999000049999 = 0.0000 0001 0016 0081 0256 0625 1296 2401 4096 6562 0001 4643 0738 8564
10026006600260001/(99996) = 0.0000 0001 0032 0243 1024 3125 7777 6810 2773 9059...
Fibonacci numbers
It is also possible to get the Fibonacci numbers in a fraction. This can be done by taking the reciprocal of a number of the form (102N - 10N - 1):
1/89 = 0.0112359550561797752808988...
1/9899 = 0.00 01 01 02 03 05 08 13 21 34 55 90 46 36 83 20 03 23 26...
1/998999 = 0.000 001 001 002 003 005 008 013 021 034 055 089 144 233 377 610 988 599 588 187 775 963 739 703 443 146 ...
Generating Functions
The interesting patterns in certain fractions are very closely related to something called generating functions. A generating function for a sequence is the function such that the fraction that it evaluates to will show that sequence in base X, where X is the input. Below are some examples:
Integers: 1/(x-1)2
Squares: (x+1)/(x-1)3
Triangular numbers: 1/(x-1)3
Fibonacci: 1/(x2 - x - 1)
Powers of 2: 1/(x-2)
Powers of 3: 1/(x-3)
Powers of 4: 1/(x-4)
Powers of 5: 1/(x-5)
Powers of n: 1/(x-n) (n can be any integer)
Cyclic numbers
A number is a cyclic number if multiplying it by an integer less than or equal to the number of digits in the number gives a cyclic permutation of the original number. The most well known example is 142857, which when multiplied by 7 gives 999999.
If numbers cannot have leading zeros, 142857 is the only cyclic number in decimal. However, there are more cyclic numbers if we assume that there are one or more leading zeros:
0588235294117647
052631578947368421
0434782608695652173913
A number is an n-level cyclic number if the number of cyclic permutations (which is obviously the same as the number of digits) of the number is equal to the generating prime minus 1, divided by n. The original cyclic numbers are 1-level cyclic numbers. 076923 is a 2-level cyclic number because 076923 multiplied by 1, 3, 4, 9, 10, or 12 gives 076923, 230769, 307692, 692307, 769230, and 923076 respectively, while multiplying by 2, 5, 6, 7, 8, or 11 gives 153846, 384615, 461538, 538461, 615384, and 846153 respectively.
Also 012345679 and 004115226337448559670781893 are 9-level cyclic numbers because multiplying by a number that is congruent to 1 modulo 9 will produce a cyclic permutation of the original number.
Below are lists of n-level cyclic numbers for each n.
1: 142857, 0588235294117647, 052631578947368421, 0434782608695652173913
2: 076923, 032258064516129, 023255813953488372093
3: 0097087378640776699029126213592233
4:
5: 09,
6:
7:
8: 02439,
9: 037, 012345679, 004115226337448559670781893, 001371742112482853223593964334705075445816186556927297668038408779149519890260631
10:
Bonus: Reciprocals of powers
This bonus section covers reciprocals of powers. I find reciprocals of powers of 3 to be the most interesting because 3 is the first number with a repeating decimal reciprocal. The first two are not very interesting:
1/3 = 0.333333333333333333333333...
1/9 = 0.1111111111111111111111111111...
But then, that is when it starts getting more interesting:
1/27 = 0.037037037037037037037037...
The repetend in 1/27 is 37 because 37*3 = 111, and thus 37*27 = 999. As it turns out, 37 is the only prime number of the form (103^(N - 2) - 1)/3n, because it divides evenly into all further such numbers.
1/81 = 0.012345679012345679012345...
It was a bit redundant to put this here, because this fraction was mentioned back in the second section. It has all the digits except 8. The repeating number in this fraction, 999999999/81 = 12,345,679, is in fact equal to 37 * 333,667, because 333667*3 = 1001001, and 1001001 * n could be considered the repetend in n/999 if it is taken 9 digits at a time, and 3/81 = 1/27 is the same as 37/999.
1/243 = 0.004115226337448559670781893004115226...
In this fraction, every block of 3 is 111 more than the one before it. The number 1027 - 1 / 243, 4,115,226,337,448,559,670,781,893, is equal to 37*111222333444555666777889, and 37 is one more than 4*9, which is why each block of three digits is 4 more than a multiple of 111.
1/729 = 0.00 137 174 211 248 285 322 359 396 433 470 507 544 581 618 655 692 729 766 803 840 877 914 951 989 026063100137174211248285322359396433...
In 1/729, every block of 3 digits is a number of the form 100 + 37n. In fact, that is how I memorized all repeating digits of 1/729. 1/729 is also the same as 1369/998001, so there would also be a pattern of all multiples of 1369, but 1369 is already a 4-digit number, which means that every term would carry into the one before it.
1/2187 = 0.00 045724737 082761774 119798811 156835848 193872885 230909922 267946959 304983996 342021033 379058070 416095107 453132144 490169181...
In 1/2187, every block of 9 digits is 37037037 more than the one before it. This pattern even continues into:
1/6561 = 0.00 015241579 027587258 039932937 052278616 064624295 076969974 089315653 101661332 114007011 126352690 138698369 151044048 163389727 175735406 188
In this fraction, every block of 9 digits is 12345679 more than the one before it. If you subtract 12345679n from the n-th block of 9 digits in 1/6561 (with the first block starting at the 3rd zero after the point), you get 2895900. Indeed, the whole reptend ends with ...28959.
The reptends in reciprocals of powers of 3 are:
3
1
37
12,345,679
4,115,226,337,448,559,670,781,893
1,371,742,112,482,853,223,593,964,334,705,075,445,816,186,556,927,297,668,038,408,779,149,519,890,260,631 (79 digits)
457,247,370,827,617,741,197,988,111,568,358,481,...259,716,506,630,086,877 (240 digits)
152,415,790,275,872,580,399,329,370,522,786,160,...,419,905,502,210,028,959 (726 digits)
50,805,263,425,290,860,133,109,790,174,262,053,...,834,070,009,653 (2,183 digits)
16,935,087,808,430,286,711,036,...,278,023,336,551 (6,557 digits)
For more on these numbers (and reptends in other reciprocals of powers), click here.