Short proofs of Midy's theorem can be given using results from
group theory. However, it is also possible to prove Midy's theorem using
elementary algebra and
modular arithmetic: Let
p be a prime and
a/
p be a fraction between 0 and 1. Suppose the expansion of
a/
p in base
b has a period of
ℓ, so \begin{align} & \frac{a}{p} = [0.\overline{a_1a_2\dots a_\ell}]_b \\[6pt] & \Rightarrow\frac{a}{p}b^\ell = [a_1a_2\dots a_\ell.\overline{a_1a_2\dots a_\ell}]_b \\[6pt] & \Rightarrow\frac{a}{p}b^\ell = N+[0.\overline{a_1a_2\dots a_\ell}]_b=N+\frac{a}{p} \\[6pt] & \Rightarrow\frac{a}{p} = \frac{N}{b^\ell-1} \end{align} where
N is the
integer whose expansion in base
b is the string
a1
a2...
aℓ. Note that
b ℓ − 1 is a multiple of
p because (
b ℓ − 1)
a/
p is an integer. Also
bn−1 is
not a multiple of
p for any value of
n less than
ℓ, because otherwise the repeating period of
a/
p in base
b would be less than
ℓ. Now suppose that
ℓ =
hk. Then
b ℓ − 1 is a multiple of
bk − 1. (To see this, substitute
x for
bk; then
bℓ =
xh and
x − 1 is a factor of
xh − 1. ) Say
b ℓ − 1 =
m(
bk − 1), so \frac{a}{p}=\frac{N}{m(b^k-1)}. But
b ℓ − 1 is a multiple of
p;
bk − 1 is
not a multiple of
p (because
k is less than
ℓ ); and
p is a prime; so
m must be a multiple of
p and \frac{am}{p}=\frac{N}{b^k-1} is an integer. In other words, N\equiv0\pmod{b^k-1}. Now split the string
a1
a2...
aℓ into
h equal parts of length
k, and let these represent the integers
N0...
Nh − 1 in base
b, so that \begin{align} N_{h-1} & = [a_1\dots a_k]_b \\ N_{h-2} & = [a_{k+1}\dots a_{2k}]_b \\ & {}\ \ \vdots \\ N_0 & = [a_{l-k+1}\dots a_l]_b \end{align} To prove Midy's extended theorem in base
b we must show that the sum of the
h integers
Ni is a multiple of
bk − 1. Since
bk is congruent to 1 modulo
bk − 1, any power of
bk will also be congruent to 1 modulo
bk − 1. So N=\sum_{i=0}^{h-1}N_ib^{ik}=\sum_{i=0}^{h-1}N_i(b^{k})^i \Rightarrow N \equiv \sum_{i=0}^{h-1}N_i \pmod{b^k-1} \Rightarrow \sum_{i=0}^{h-1}N_i \equiv 0 \pmod{b^k-1} which proves Midy's extended theorem in base
b. To prove the original Midy's theorem, take the special case where
h = 2. Note that
N0 and
N1 are both represented by strings of
k digits in base
b so both satisfy 0 \leq N_i \leq b^k-1.
N0 and
N1 cannot both equal 0 (otherwise
a/
p = 0) and cannot both equal
bk − 1 (otherwise
a/
p = 1), so 0 and since
N0 +
N1 is a multiple of
bk − 1, it follows that N_0+N_1 = b^k-1. ==Corollary==