Image via Wikipedia

If you've messed with a calculator for any length of time, you'll have noticed that when division isn't exact, the calculator has this nasty habit of responding with a decimal answer that fills the entire display. For instance, if you ask your calculator to evaluate that common approximation to *pi*, 22/7. The calculator will respond with something like 3.1428571; if you have a slightly more sophisticated calculator, you'll see the next two digits are 42; and, as you might correctly guess, the sequence 142857 goes on 'forever'. (Yes, I'll admit it. I'm being a bit careful with my choice of words here. The idea of a sequence of digits that goes on 'forever' is actually something abstract. Decimal expansions, streams of digits, exist so we can write numbers down. If a stream of digits really did go on 'forever' – well, we'd never finish writing it out). It turns out that's actually the norm when it comes to the decimal expansion for fractions. If (once we've reduced to lowest terms) the only factors that appear in the denominator are 2 and/or 5, then the decimal expansion comes to an end (because 2 and 5 are the factors of 10, the base of our number system). Otherwise, the decimal expansion of a fraction eventually repeats.

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

Related articles by Zemanta

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