# Prime denominators and nines complement

Let p be a prime. If the repeating decimal for the fraction a/p has even period, the second half of the decimals are the 9’s complement of the first half. This is known as Midy’s theorem. For a small example, take 1/7 = 0.142857142857… and notice that 142 + 857 = 999. That is, 8, 5, and […]