Midy's Theorem/Examples/7

Example of Use of Midy's Theorem
Let $p = 7$.

We have for $a = 1$ and $b = 10$ the decimal expansion:


 * $\dfrac 1 7 = 0 \cdotp \dot 14285 \dot 7$

Hence:
 * $N = 142857$

This means that:
 * $\alpha = 6 = 2 \times 3$

Midy's Theorem states that $N$ is divisible by $10^2 - 1$ and $10^3 - 1$.

Moreover, we can partition $N$ into blocks of digits of equal length:


 * $N = 14 \times 100^2 + 28 \times 100 + 57$


 * $N = 142 \times 1000 + 857$

Summing these blocks together, we obtain:
 * $14 + 28 + 57 = 99 = 10^2 - 1$

and:
 * $142 + 857 = 999 = 10^3 - 1$