Midy's theorem

From HandWiki
Short description: On decimal expansions of fractions with prime denominator and even repeat period

In mathematics, Midy's theorem, named after France 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

[math]\displaystyle{ \frac{a}{p}=0.\overline{a_1a_2a_3\dots a_na_{n+1}\dots a_{2n}} }[/math]

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,

[math]\displaystyle{ a_i+a_{i+n}=9 }[/math]
[math]\displaystyle{ a_1\dots a_n+a_{n+1}\dots a_{2n}=10^n-1. }[/math]

For example,

[math]\displaystyle{ \frac{1}{13}=0.\overline{076923}\text{ and }076+923=999. }[/math]
[math]\displaystyle{ \frac{1}{17}=0.\overline{0588235294117647}\text{ and }05882352+94117647=99999999. }[/math]

Extended Midy's theorem

If k is any divisor of h (where h is the number of digits of the period of the decimal expansion of a/p (where p is again a prime)), then Midy's theorem can be generalised as follows. The extended Midy's theorem[2] states that if the repeating portion of the decimal expansion of a/p is divided into k-digit numbers, then their sum is a multiple of 10k − 1.

For example,

[math]\displaystyle{ \frac{1}{19}=0.\overline{052631578947368421} }[/math]

has a period of 18. Dividing the repeating portion into 6-digit numbers and summing them gives

[math]\displaystyle{ 052631+578947+368421=999999. }[/math]

Similarly, dividing the repeating portion into 3-digit numbers and summing them gives

[math]\displaystyle{ 052+631+578+947+368+421=2997=3\times999. }[/math]

Midy's theorem in other bases

Midy's theorem and its extension do not depend on special properties of the decimal expansion, but work equally well in any base b, provided we replace 10k − 1 with bk − 1 and carry out addition in base b.

For example, in octal

[math]\displaystyle{ \begin{align} & \frac{1}{19}=0.\overline{032745}_8 \\[8pt] & 032_8+745_8=777_8 \\[8pt] & 03_8+27_8+45_8=77_8. \end{align} }[/math]

In duodecimal (using inverted two and three for ten and eleven, respectively)

[math]\displaystyle{ \begin{align} & \frac{1}{19}=0.\overline{076\mathcal{E}45}_{12} \\[8pt] & 076_{12}+\mathcal{E}45_{12}=\mathcal{EEE}_{12} \\[8pt] & 07_{12}+6\mathcal{E}_{12}+45_{12}=\mathcal{EE}_{12} \end{align} }[/math]

Proof of Midy's theorem

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

[math]\displaystyle{ \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} }[/math]

where N is the integer whose expansion in base b is the string a1a2...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

[math]\displaystyle{ \frac{a}{p}=\frac{N}{m(b^k-1)}. }[/math]

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

[math]\displaystyle{ \frac{am}{p}=\frac{N}{b^k-1} }[/math]

is an integer. In other words,

[math]\displaystyle{ N\equiv0\pmod{b^k-1}. }[/math]

Now split the string a1a2...a into h equal parts of length k, and let these represent the integers N0...Nh − 1 in base b, so that

[math]\displaystyle{ \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} }[/math]

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

[math]\displaystyle{ N=\sum_{i=0}^{h-1}N_ib^{ik}=\sum_{i=0}^{h-1}N_i(b^{k})^i }[/math]
[math]\displaystyle{ \Rightarrow N \equiv \sum_{i=0}^{h-1}N_i \pmod{b^k-1} }[/math]
[math]\displaystyle{ \Rightarrow \sum_{i=0}^{h-1}N_i \equiv 0 \pmod{b^k-1} }[/math]

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

[math]\displaystyle{ 0 \leq N_i \leq b^k-1. }[/math]

N0 and N1 cannot both equal 0 (otherwise a/p = 0) and cannot both equal bk − 1 (otherwise a/p = 1), so

[math]\displaystyle{ 0 \lt N_0+N_1 \lt 2(b^k-1) }[/math]

and since N0 + N1 is a multiple of bk − 1, it follows that

[math]\displaystyle{ N_0+N_1 = b^k-1. }[/math]

Corollary

From the above,

[math]\displaystyle{ \frac{am}{p} }[/math] is an integer

Thus [math]\displaystyle{ m \equiv 0 \pmod p }[/math]

And thus for [math]\displaystyle{ k = \frac{\ell}{2} }[/math]

[math]\displaystyle{ b^{\ell/2}+ 1 \equiv 0 \pmod p }[/math]

For [math]\displaystyle{ k = \frac{\ell}{3} }[/math] and is an integer

[math]\displaystyle{ b^{2\ell/3} + b^{\ell/3} + 1 \equiv 0 \pmod p }[/math]

and so on.

Notes

  1. Leavitt, William G. (June 1967). "A Theorem on Repeating Decimals". The American Mathematical Monthly (Mathematical Association of America) 74 (6): 669–673. doi:10.2307/2314251. http://digitalcommons.unl.edu/mathfacpub/48/. 
  2. Bassam Abdul-Baki, Extended Midy's Theorem, 2005.

References

  • Rademacher, H. and Toeplitz, O. The Enjoyment of Mathematics: Selections from Mathematics for the Amateur. Princeton, NJ: Princeton University Press, pp. 158–160, 1957. MR0081844
  • E. Midy, "De Quelques Propriétés des Nombres et des Fractions Décimales Périodiques". College of Nantes, France: 1836.
  • Ross, Kenneth A. "Repeating decimals: a period piece". Math. Mag. 83 (2010), no. 1, 33–45. MR2598778

External links