# 米迪定理

• 若將這個分數用循環小數寫成${\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].