# The Cool Thing about Repeating Decimals

Get out your calculator and type in 331/999 and press enter. What do you get? Something along the lines of 0.331331331…? Now type in 21/9999 and press enter. What do you get? 0.002100210021…? This cool trick works with any fraction less than 1 with all nines in the denominator, which are always of the form 10^{A} – 1, for some number A. Here’s a proof:

- Say x = 0.A
_{1}A_{2}A_{3}…A_{n}…… (Where x is a repeating decimal, and A_{1}A_{2}A_{3}…A_{n }is the string of numbers that is repeated in the decimal, and n is the length of the string) - If we multiply both sides by 10
^{n}, then we would get: x10^{n}= A_{1}A_{2}A_{3}…A_{n}.A_{1}A_{2}A_{3}…A_{n}…, because the decimal point is moved n times to the right - x10
^{n}= A_{1}A_{2}A_{3}…A_{n}.A_{1}A_{2}A_{3}…A_{n}… is the same thing as A_{1}A_{2}A_{3}…A_{n }+ 0.A_{1}A_{2}A_{3}…A_{n}, and since 0.A_{1}A_{2}A_{3}…A_{n}= x, then x10^{n}= A_{1}A_{2}A_{3}…A_{n }+ x - By subtracting both sides of the equation by x, you would get x10
^{n }– x = A_{1}A_{2}A_{3}…A_{n}, or x(10^{n }– 1) = A_{1}A_{2}A_{3}…A_{n} - By dividing both sides by 10
^{n}– 1, you would get… x = (A_{1}A_{2}A_{3}…A_{n})/(10^{n}– 1) - Therefore, by substituting 0.A
_{1}A_{2}A_{3}…A_{n}… for x, you would get… - A
_{1}A_{2}A_{3}…A_{n}… = (A_{1}A_{2}A_{3}…A_{n})/(10^{n}– 1), where A_{1}A_{2}A_{3}…A_{n}is a string of numbers of length n, and 10^{n }– 1 is a string of n 9s, for example 10^{3}– 1 = 1000 – 1 = 999

This proof is a generalization of a trick you learn in middle school. Say you want to convert 0.21… into a fraction. You would set that equal to x to get x = 0.21… and multiply both sides by 100 to get 100x = 21.21…, which is 100x = 21 + 0.21…, or 100x = 21 + x. Next you would subtract x from both sides to get 99x = 21, and x = 21/99. Don’t forget to simplify J.

Note: If you want to do something like 7/99999, add 0s in front of the 7 to make the numerator and denominator have the same number of digits to get 00007/99999, and the decimal of that would be .000070000700007…