Image via Wikipedia
There's some immediate questions that might spring to mind, such as, how many digits long is the repeating cycle? 1/3 is 0.3333333... the pattern is one digit long. Likewise 1/6 is 0.1666666... - after that initial 1, the pattern is again one digit long. 1/7 is 0.142857... and that pattern is six digits long. What's happening? It turns out the length of the pattern can be at most one less than the denominator. A simple explanation would be to consider how you would work out the decimal expansion using pencil and paper. it would be a long division problem into n.0000... (where n is the numerator) - the string of zeroes on the right of the decimal point going on 'forever'. At each digit, the remainder carried to the next digit takes one of the values 1, 2, ... d-1, where d is the denominator. There are no other possibilities; the remainder at each step has to be less than d, and the remainder can't be zero, because the calculation doesn't terminate. Once a remainder repeats, the sequence forever thereafter also repeats. The enterprising of you might want to start Googling for things like the "order of 10, modulo d". The actual length of the repeating cycle can be determined.
The process works the other way around as well. Any repeating sequence of digits represents a fraction. For instance, the decimal 0.153439153439..., those six digits repeating over and over again, represents 153439/999999, or, in it's simplest form, 29/189. Similarly, even if the sequence doesn't immediately repeat, it still represents a fraction. For example, given the number X = 0.123153439153439...., that's also a fraction. To prove it, note that 1000X = 123 + 29/189 and then solve for X.
The recurring decimal pattern, occurring for sequences of digits that represent fractions, is so common that even if we try to construct some particularly unusual decimals, we'll get fractional answers and recurring patterns all over again. For instance, what if we start writing down the number 0.1234567... - the pattern continuing 8, 9, 10, 11.... Things start to get a bit tricky if we want to put numbers greater than 9 in a single digit position, so we have to worry about carries. What is this value? We can calculate it by writing
X = 0/1 + 1/10 + 2/100 + 3/1000 + 4/10000 + ....
and thus
10X = 0/10 + 1/1 + 2/10 + 3/100 + 4/1000 + ....
and subtracting one from the other
9X = 1/1 + 1/10 + 1/100 + 1/1000 + = 10/9
giving X = 10/81. It turns out that number X is 0.123456790123456790... - remarkably, the digits line up, repeating every nine positions, even with all the carries from digit to digit, and not a single digit 8 survives.
We can even make some even more difficult calculations. Consider the Fibonacci sequence 1, 1, 2, 3, 5, 8, 13, 21, 34... where each term is the sum of the two preceding ones. For clarity, write this out with each entry taking two digits (and, as before, we'll get carries occurring once numbers get larger). What is the value of X = 0.01010203050813213455....? Believe it or not, the answer is 101/9899. Can you prove it?
- Fraction Help: Converting to Decimal (brighthub.com)
- Help with Decimals: Converting to Fraction (brighthub.com)
- Nerdy Number Corner: 142857 and Other Mathematical Parasites (reinventingme.posterous.com)
- Nerdy Number Corner: Peculiar Pythagorean Puzzlers (reinventingme.posterous.com)
- Nerdy Number Corner: Perfectly Amicable (reinventingme.posterous.com)