Midy’s Theorem

The decimal expansion of 1/7 is

0.142857142857 …

Interestingly, if you split the repeating decimal period in half and add the two complements, you get a string of 9s:

142 + 857 = 999

It turns out this is true for every fraction with a prime denominator and a repeating decimal period of even length:

1/11 = 0.090909 …
0 + 9 = 9

1/13 = 076923 …
076 + 923 = 999

1/17 = 0.0588235294117647 …
05882352 + 94117647 = 99999999

1/19 = 0.052631578947368421 …
052631578 + 947368421 = 999999999

It was discovered by French mathematician E. Midy in 1836.