Midy's theorem

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,

  1. ^ Leavitt, William G. (June 1967). "A Theorem on Repeating Decimals". The American Mathematical Monthly. 74 (6). Mathematical Association of America: 669–673. doi:10.2307/2314251. JSTOR 2314251. MR 0211949.