The Prime Factors of 999999

The prime factorization of 999999 allows us to compute repeating decimals for some common fractions. I work through this idea.

Repetends

The prime factorization of 999999999999 is interesting. It is:

999999=3×3×3×7×11×13×37.(1) 999999 = 3 \times 3 \times 3 \times 7 \times 11 \times 13 \times 37. \tag{1}

We can use this to find the repeating decimal representation of some common fractions. To see this, first note that we can write the reciprocal of 999999999999 as

19999999=0.999999999999=0.000001.(2) \frac{1}{9999999} = \frac{0.\overline{999999}}{999999} = 0.\overline{000001}. \tag{2}

Using this fact, here is the decimal representation of 1/71/7:

17=3×3×3×11×13×37999999=142857999999=0.142857.(3) \frac{1}{7} = \frac{3 \times 3 \times 3 \times 11 \times 13 \times 37}{999999} = \frac{142857}{999999} = 0.\overline{142857}. \tag{3}

Clearly, this idea works for any factor of 999999999999. In the case of the prime factors above, we have:

13=333333999999=0.333333,17=142857999999=0.142857,111=90909999999=0.090909,113=62937999999=0.062937,137=27027999999=0.027027.(4) \begin{aligned} \\ \frac{1}{3} &= \frac{333333}{999999} = 0.\overline{333333}, \\\\ \frac{1}{7} &= \frac{142857}{999999} = 0.\overline{142857}, \\\\ \frac{1}{11} &= \frac{90909}{999999} = 0.\overline{090909}, \\\\ \frac{1}{13} &= \frac{62937}{999999} = 0.\overline{062937}, \\\\ \frac{1}{37} &= \frac{27027}{999999} = 0.\overline{027027}. \end{aligned} \tag{4}

And of course, this idea works for non-prime factors. For example:

127=7×11×13×37999999=37037999999=0.037037.(5) \frac{1}{27} = \frac{7 \times 11 \times 13 \times 37}{999999} = \frac{37037}{999999} = 0.\overline{037037}. \tag{5}

The repeated number in the decimal, e.g. 142857142857, is called the repetend or reptend. In the case of 1/71/7, the repetend is actually a cyclic number, and therefore we can easily compute other fractions such as 3/73/7 by simply rotating the digits in the repetend appropriately, e.g.,

37=0.428571.(6) \frac{3}{7} = 0.\overline{428571}. \tag{6}

Furthermore, this gives us a nice trick to compute repeating decimals when the denominator is a multiple of seven, such as

114=0.57=5071100=0.07142857.(7) \frac{1}{14} = \frac{0.5}{7} = \frac{50}{7} \frac{1}{100} = 0.07\overline{142857}. \tag{7}

Basically, you have to do some long-division in your head, but the moment you get a remainder you recognize, you’re essentially done.

For 1/111/11, note that we can use our nines times table to easily compute other fractions repetends, such as

411=0.363636.(8) \frac{4}{11} = 0.\overline{363636}. \tag{8}

Of course, we are only scratching the mathematical surface here. A proper generalization for why this works lies in number theory. But I just wanted to document for myself this simple case, since it justifies some common rules used when computing fractions.

Prime factorization

One might ask: how could we compute the prime factorization of 999999999999 “by hand”? The way I was taught was to observe that

999999=1001×999,(9) 999999 = 1001 \times 999, \tag{9}

and to then brute-force 10011001, which isn’t too hard since we only have to check odd numbers up to roughly 3232. But a more elegant way in my mind is to use the difference of two squares and the sum of two cubes:

999999=(1061)=(1031)(103+1)=(1031)(10+1)(10210+1)=999×11×91.(10) \begin{aligned} 999999 &= (10^6 - 1) \\ &= (10^3 - 1)(10^3 + 1) \\ &= (10^3 - 1)(10 + 1)(10^2 - 10 + 1) \\ &= 999 \times 11 \times 91. \end{aligned} \tag{10}

Using times tables and basic divisibility rules, e.g. 999999 and 111111 are clearly divisible by three, we can easily factorize the remaining terms. I took this idea from here.