米迪定理

• 若將這個分數用循環小數寫成${\displaystyle 0.{\overline {a_{1}a_{2}a_{3}...a_{n}a_{n+1}...a_{2n}}}}$，則
• ${\displaystyle a_{i}+a_{i+n}=b-1}$
• ${\displaystyle a_{1}\dots a_{n}+a_{n+1}\dots a_{2n}=b^{n}-1.}$

例

${\displaystyle {\frac {1}{17}}=0.{\overline {0588235294117647}}}$（10進制）

• 0+9=10-1，5+4=10-1，8+1=10-1……
• ${\displaystyle 05882352+94117647=10^{8}-1}$
${\displaystyle {\frac {1}{19}}=0.{\overline {052631578947368421}}}$（10進制）

• 0+9=10-1，5+4=10-1，2+7=10-1……
• ${\displaystyle 052631578+947368421=10^{9}-1}$
• ${\displaystyle 052631+578947+368421=10^{6}-1}$（廣義米迪定理，k=6）
• ${\displaystyle 052+631+578+947+368+421=2997=3\times (10^{3}-1)}$（廣義米迪定理，k=3）
${\displaystyle {\frac {1}{19}}=0.{\overline {032745}}_{8}}$
• ${\displaystyle 032_{8}+745_{8}=777_{8}}$
• ${\displaystyle 03_{8}+27_{8}+45_{8}=77_{8}.}$

定理的證明

p為質數，a/p是0與1之間的分數。假設在b進制中，a/p的展開式的週期為l，所以：

${\displaystyle {\frac {a}{p}}=[0.{\overline {a_{1}a_{2}\dots a_{l}}}]_{b}}$
${\displaystyle \Rightarrow {\frac {a}{p}}b^{l}=[a_{1}a_{2}\dots a_{l}.{\overline {a_{1}a_{2}\dots a_{l}}}]_{b}}$
${\displaystyle \Rightarrow {\frac {a}{p}}b^{l}=N+[0.{\overline {a_{1}a_{2}\dots a_{l}}}]_{b}=N+{\frac {a}{p}}}$
${\displaystyle \Rightarrow {\frac {a}{p}}={\frac {N}{b^{l}-1}}}$

${\displaystyle {\frac {a}{p}}={\frac {N}{m(b^{k}-1)}}.}$

bl−1是p的倍數；bk−1不是p的倍數（因為k小於l）；且p是質數；因此m一定是p的倍數，且

${\displaystyle {\frac {am}{p}}={\frac {N}{b^{k}-1}}}$

${\displaystyle N\equiv 0{\pmod {b^{k}-1}}.}$

${\displaystyle N_{h-1}=[a_{1}\dots a_{k}]_{b}}$
${\displaystyle N_{h-2}=[a_{k+1}\dots a_{2k}]_{b}}$
${\displaystyle .}$
${\displaystyle .}$
${\displaystyle N_{0}=[a_{l-k+1}\dots a_{l}]_{b}}$

${\displaystyle N=\sum _{i=0}^{h-1}N_{i}b^{ik}=\sum _{i=0}^{h-1}N_{i}(b^{k})^{i}}$
${\displaystyle \Rightarrow N\equiv \sum _{i=0}^{h-1}N_{i}{\pmod {b^{k}-1}}}$
${\displaystyle \Rightarrow \sum _{i=0}^{h-1}N_{i}\equiv 0{\pmod {b^{k}-1}}}$

${\displaystyle 0\leq N_{i}\leq b^{k}-1.}$

N0N1不能都等於0（否則a/p = 0），也不能都等於bk − 1（否則a/p = 1），因此：

${\displaystyle 0

${\displaystyle N_{0}+N_{1}=b^{k}-1.}$

參考資料

1. ^ 有些質數的循環節長度是奇數，如3、31。

William G. Leavitt. A THEOREM ON REPEATING DECIMALS. The American Mathematical Monthly. 1967年6月, 74 (6): 669–673 [2014-12-29].