On decimal expansions of fractions with prime denominator and even repeat period
In mathematics, Midy's theorem, named after French mathematician E. Midy,[1] is a statement about the decimal expansion of fractions a/p where p is a prime and a/p has a repeating decimal expansion with an even period (sequence A028416 in the OEIS). If the period of the decimal representation of a/p is 2n, so that
then the digits in the second half of the repeating decimal period are the 9s complement of the corresponding digits in its first half. In other words,
For example,