# 互素整数

**互素整数**是两个或更多整数，其唯一的公共正除数为 1；等价地，它们的最大公约数为 1。这一性质也称为互素性，或说两数互素；互素整数偶尔被称为陌数。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 这个概念是数论中最古老的概念之一：欧几里得（Euclid）的《几何原本》（Elements）在第七卷中将互素数定义为“仅以单位作为共同度量来度量”的数，并发展了判定这一性质的相减算法。<sup>[2](https://aleph0.clarku.edu/~djoyce/elements/bookVII/bookVII.html)</sup>

| 关键事实 | 细节 |
|---|---|
| 定义 | 当 gcd(m, n) = 1 时，整数 m 和 n 互素，也就是说，除 1 外它们没有公共正除数<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> |
| 古典来源 | 欧几里得，《几何原本》第七卷，定义12：互素的数仅以单位作为共同度量来度量<sup>[2](https://aleph0.clarku.edu/~djoyce/elements/bookVII/bookVII.html)</sup> |
| 贝祖（Bézout）等式 | 对于自然数 a 和 b，存在整数 s 和 t，使得 s·a + t·b = gcd(a, b)；当 a 与 b 互素时，此式写作 s·a + t·b = 1<sup>[3](https://math-sites.uncg.edu/sites/pauli/112/HTML/secbezout.html)</sup> |
| 模逆元 | a 模 n 的逆元存在，当且仅当 a 与 n 互素<sup>[4](https://case.edu/artsci/math/singer/Sage3/mod-inverse.html)</sup> |
| 欧拉（Euler）定理 | 若 gcd(a, n) = 1，则 a 的 φ(n) 次方模 n 同余于 1<sup>[5](https://ccs.neu.edu/home/vip/teach/DiscreteMathACC/html/notes/number_theory.pdf)</sup> |
| 随机数对 | 随机选取两个整数，它们互素的概率为 1/ζ(2) = 6/π² ≈ 0.60792<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> |
| 不传递 | (2, 3) = 1 且 (3, 4) = 1，但 (2, 4) = 2，所以互素性不传递<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> |

## 定义与基本例子

两个整数 m 和 n 互素，恰好当 gcd(m, n) = 1，其中 gcd 表示最大公约数。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 两个不同的素数 p 和 q 总是互素；不同素数的任意正幂也互素，因为 (p^m, q^n) = 1。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 素数 p 与任何它不能整除的整数互素，因为 p 的除数只有 1 和 p。<sup>[6](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup>

这一性质取决于数对，而不是分别取决于每个数。8 和 15 互素，尽管两者都不是素数；而 8 和 12 不互素，因为两者都能被 4 整除。将两个整数除以它们的最大公约数 d，总会留下一对互素的数：gcd(a/d, b/d) = 1。<sup>[5](https://ccs.neu.edu/home/vip/teach/DiscreteMathACC/html/notes/number_theory.pdf)</sup>

互素性不传递：2 与 3 互素，3 与 4 互素，但 2 和 4 共有因子 2。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 三元组会出现一个相关的微妙之处：有可能 gcd(a, b)、gcd(b, c)、gcd(c, a) 都大于 1，而 gcd(a, b, c) = 1；因此，一组整数可以没有大于 1 的公约数，尽管其中没有任何一对互素。<sup>[7](https://users.renyi.hu/~magap/classes/bsm/19_summer_number_theory/introduction_to_number_theory.pdf)</sup> 当一个集合中的每一对都互素时，这个集合称为两两互素。<sup>[8](https://crypto.stanford.edu/pbc/notes/numbertheory/crt.html)</sup>

## 欧几里得的处理

《几何原本》第七卷以如下定义开篇：“互素的数，是仅以单位作为共同度量来度量的数。”<sup>[2](https://aleph0.clarku.edu/~djoyce/elements/bookVII/bookVII.html)</sup> 该卷命题1以反复相减的形式给出判定程序：若从两个不等数中轮流用较大者减去较小者，过程最终剩下一单位，则原两数互素。<sup>[9](https://www.perseus.tufts.edu/hopper/text?doc=Euc.+7&fromdoc=Perseus%3Atext%3A1999.01.0086)</sup> 这种反复相减（anthyphairesis）是欧几里得算法的前身，它计算最大公约数；当且仅当该除数为 1 时，这对数互素。<sup>[6](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup>

欧几里得还证明了依赖互素性的结果。命题 VII.29 指出，素数与其不能整除的任何数互素；而“若素数整除一个乘积，则它整除其中一个因子”这一引理，即欧几里得引理，要求该素数与其他因子互素。<sup>[10](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S4.html)</sup>

## 贝祖等式与线性组合

贝祖等式指出，对所有自然数 a 和 b，存在整数 s 和 t，使得 s·a + t·b = gcd(a, b)；这些系数可通过欧几里得算法回代求得。<sup>[3](https://math-sites.uncg.edu/sites/pauli/112/HTML/secbezout.html)</sup> 这一刻画使互素性成为一个整数能以所需方式表示为另一个整数的整数组合的精确条件，并且它构成了用于计算系数的扩展欧几里得算法的基础。<sup>[3](https://math-sites.uncg.edu/sites/pauli/112/HTML/secbezout.html)</sup>

## 模算术

互素性决定哪些模计算可以进行。a 模 n 的乘法逆元，即满足 a·x ≡ 1 (mod n) 的整数 x，存在当且仅当 a 与 n 互素。<sup>[4](https://case.edu/artsci/math/singer/Sage3/mod-inverse.html)</sup> 因此，ℤₙ 的单位（即有逆元的剩余类）恰好就是与 n 互素的剩余类，其个数由欧拉总计函数 φ(n) 给出，即 [1..n] 中与 n 互素的整数个数。<sup>[11](https://crypto.stanford.edu/pbc/notes/numbertheory/units.html)</sup> 对素数 p，每个非零剩余都与 p 互素，所以 φ(p) = p − 1；对素数幂，φ(p^k) = p^k − p^(k−1)。<sup>[11](https://crypto.stanford.edu/pbc/notes/numbertheory/units.html)</sup>

**欧拉定理**指出，若 gcd(a, n) = 1，则 a^φ(n) ≡ 1 (mod n)；对任意与 n 互素的 a，总计函数起着阶的作用；当已知 φ(n) 时，它给出逆元 a^(φ(n)−1) mod n。<sup>[5](https://ccs.neu.edu/home/vip/teach/DiscreteMathACC/html/notes/number_theory.pdf)</sup> 当 n 为素数时，这退化为费马（Fermat）小定理：a^(p−1) ≡ 1 (mod p)。<sup>[5](https://ccs.neu.edu/home/vip/teach/DiscreteMathACC/html/notes/number_theory.pdf)</sup>

中国剩余定理以两两互素的模数来陈述：若 m₁, …, mₙ 在 i ≠ j 时满足 gcd(mᵢ, mⱼ) = 1，则同余方程组 x ≡ aᵢ (mod mᵢ) 在模乘积 M = m₁⋯mₙ 下有唯一解。<sup>[8](https://crypto.stanford.edu/pbc/notes/numbertheory/crt.html)</sup> 证明需要 Nᵢ = M/mᵢ 模 mᵢ 的逆元；这些逆元存在，正是因为模数两两互素。<sup>[12](https://www.math.uci.edu/~ndonalds/math180a/notes-full.pdf)</sup> 当模数不互素时，乘积必须替换为最小公倍数，而且解可能不存在。<sup>[13](https://a-warded.org/open-book/university-number-theory/lesson-16)</sup>

## 互素的概率

整数中互素数对的密度是概率数论的一个经典结果。随机选取两个整数，它们互素的概率为

\[ P((m,n)=1) = \zeta(2)^{-1} = \frac{6}{\pi^2} \approx 0.60792, \]

这一结果归功于切萨罗（Cesàro）和西尔维斯特（Sylvester）在 1883 年的工作，后来莱默（Lehmer）于 1900 年、尼曼（Nymann）于 1972 年又作了处理。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 帮助创立概率数论的意大利数学家埃内斯托·切萨罗，早在 1881 年就已观察到 6/π² 这个值。<sup>[14](https://iris.uniroma1.it/retrieve/e3835328-a7cb-15e8-e053-a505fe0a3de9/Gambini_Probability-of-digits-preprint_2012.pdf)</sup> 同一个数也是平面中从原点可见的格点所占的比例，因为点 (m, n) 可见当且仅当 gcd(m, n) = 1。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup>

该结果可推广到更多整数。随机选取三个整数，没有公因子同时整除三者的概率为 ζ(3)^(−1) ≈ 0.83190，其中 ζ(3) 是阿佩里（Apéry）常数；一般地，n 个随机数没有共同的 p 次幂除数的概率为 ζ(np)^(−1)。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> J. E. 尼曼 1972 年发表在《数论杂志》（Journal of Number Theory）上的论文讨论了从 {1, 2, …, n} 中选取 k 个整数互素的概率 P_k(n)，并证明当 k ≥ 2 时极限存在。<sup>[15](https://www.sciencedirect.com/science/article/pii/0022314X72900388)</sup> 两两互素性比没有公约数更强：随机选取一个正整数三元组，它两两不互素的概率约为 17.4%。<sup>[16](https://arxiv.org/abs/1309.5578)</sup>

同样的问题在其他整数环中也有意义。对两个随机高斯整数（Gaussian integers），即 a、b 为整数的数对 a + bi，它们互素的概率为 6/(π²K) ≈ 0.66370，其中 K 是卡塔兰（Catalan）常数；对艾森斯坦整数（Eisenstein integers），相应概率约为 0.77809。<sup>[1](https://mathworld.wolfram.com/RelativelyPrime.html)</sup> 2018 年的一项研究证明，黎曼（Riemann）假设与两个独立的几何分布随机变量的互素概率在分布参数趋于 0 时收敛到 6/π² 的速度之间存在等价关系。<sup>[17](https://onlinelibrary.wiley.com/doi/10.1002/mana.201600526)</sup>

## 总计函数的记号与历史

卡尔·弗里德里希·高斯（Carl Friedrich Gauss）于 1801 年给出记号 φ(m)，用于计数小于 m 且与 m 互素的整数有多少个，并在《算术研究》（Disquisitiones arithmeticae）第 38 条和第 39 条中提出；然而，这一函数本身此前已由莱昂哈德·欧拉研究过，欧拉在 1780 年将其写作 πN。<sup>[18](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/nth/)</sup> 詹姆斯·约瑟夫·西尔维斯特为这一函数引入了“总计函数”（totient）这一名称，但他偏爱自己的符号 τn，称欧拉的 φ 不过是希腊字母表中一个并无理由优于其他字母的字母。<sup>[18](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/nth/)</sup>

## References

1. [Weisstein, Eric W. "Relatively Prime." MathWorld, Wolfram Research.](https://mathworld.wolfram.com/RelativelyPrime.html)
2. [Euclid's Elements, Book VII (definitions), David E. Joyce, Clark University.](https://aleph0.clarku.edu/~djoyce/elements/bookVII/bookVII.html)
3. [Bézout's Identity, Section 4.4, University of North Carolina at Greensboro.](https://math-sites.uncg.edu/sites/pauli/112/HTML/secbezout.html)
4. [Modular Inverse, Sage notes, Case Western Reserve University.](https://case.edu/artsci/math/singer/Sage3/mod-inverse.html)
5. [Introduction to Number Theory, Northeastern University course notes.](https://ccs.neu.edu/home/vip/teach/DiscreteMathACC/html/notes/number_theory.pdf)
6. [Greatest divisors, Bézout and the Euclidean algorithm, University of British Columbia.](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)
7. [Introduction to number theory, Rényi Institute course notes.](https://users.renyi.hu/~magap/classes/bsm/19_summer_number_theory/introduction_to_number_theory.pdf)
8. [The Chinese Remainder Theorem, Ben Lynn, Stanford University notes.](https://crypto.stanford.edu/pbc/notes/numbertheory/crt.html)
9. [Euclid, Elements, Book VII, Perseus Digital Library, Tufts University.](https://www.perseus.tufts.edu/hopper/text?doc=Euc.+7&fromdoc=Perseus%3Atext%3A1999.01.0086)
10. [Applications of Bézout's Theorem, MATH111, Lancaster University.](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S4.html)
11. [Units and the Totient Function, Ben Lynn, Stanford University notes.](https://crypto.stanford.edu/pbc/notes/numbertheory/units.html)
12. [Theorem 4.14 (Chinese Remainder Theorem), Math 180A notes, University of California, Irvine.](https://www.math.uci.edu/~ndonalds/math180a/notes-full.pdf)
13. [Simultaneous Congruences and the Chinese Remainder Theorem, A-Warded open book.](https://a-warded.org/open-book/university-number-theory/lesson-16)
14. [Gambini, A. On Cesàro's contributions to probabilistic number theory (preprint), Sapienza Università di Roma.](https://iris.uniroma1.it/retrieve/e3835328-a7cb-15e8-e053-a505fe0a3de9/Gambini_Probability-of-digits-preprint_2012.pdf)
15. [Nymann, J. E. "On the probability that k positive integers are relatively prime." Journal of Number Theory 4 (1972), 469–473.](https://www.sciencedirect.com/science/article/pii/0022314X72900388)
16. [Pairwise non-coprimality of triples, arXiv:1309.5578.](https://arxiv.org/abs/1309.5578)
17. [Bureaux, S. "The probability that two random integers are coprime." Mathematische Nachrichten (2018).](https://onlinelibrary.wiley.com/doi/10.1002/mana.201600526)
18. [Earliest Uses of Symbols of Number Theory, MacTutor History of Mathematics.](https://mathshistory.st-andrews.ac.uk/Miller/mathsym/nth/)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Elementary number theory › Divisibility, GCD, and the integers

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/coprime-integers

English original: https://www.edgepedia.org/coprime-integers
