# 除数

整数 n 的**除数**是这样一个整数 d：n 除以 d 没有余数；这种关系记作 d | n。除数也称为因子，对除数性质的研究，连同素数与最大公约数一起，构成了数论的起点。<sup>[1](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 当且仅当存在整数 q 使 n = dq 时，d 是 n 的除数（因子）；记号为 d \| n<sup>[1](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)</sup> |
| 素数 | 自然数 p 是素数，当且仅当它恰有两个正除数：1 和 p；由于 1 只有一个正除数，所以它不是素数<sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup> |
| 唯一分解 | 每个大于 1 的整数要么是素数，要么是两个或更多素数的乘积，且在不计因子次序的意义下分解唯一<sup>[1](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)</sup><sup> • </sup><sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup> |
| 最大公约数 | gcd(a, b) 是同时整除 a 和 b 的最大正整数；若 gcd(a, b) = 1，则称 a 与 b 互素<sup>[3](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup> |
| 欧几里得算法 | 带余除法反复进行即可计算 gcd，依据是当 a = bq + r 时 gcd(a, b) = gcd(b, r)；该方法见于欧几里得《几何原本》第七卷（约公元前 300 年）<sup>[4](https://math.mit.edu/research/highschool/primes/circle/documents/2024/Honglin.pdf)</sup><sup> • </sup><sup>[5](https://mathshistory.st-andrews.ac.uk//Biographies/Euclid/)</sup> |
| 除数计数 | 除数函数 τ(n) 计算 n 的除数个数；对不超过 x 的所有正整数 n 求和，总数为 x log x + (2γ − 1)x 加上一个更小的误差项，因此除数的平均个数按 log x 增长<sup>[6](https://webhomes.maths.ed.ac.uk/~chris/NTh/Number_Theory_Notes2012.pdf)</sup> |

## 定义与基本性质

整除性通过乘法来定义：当存在整数 q 使 n = dq 时，称 d 整除 n。每个非零整数至少有除数 1 和它自身，而 1 整除每个整数；这是最大公约数总有定义的原因之一，因为公约数总是存在，且一个数的任何除数在绝对值上都不会超过该数本身。<sup>[7](https://zoo.cs.yale.edu/classes/cs467/2006f/attach/ln08.html)</sup> 除数成对出现：若 d 整除 n，则 n/d 也整除 n，因此用试除法寻找除数时，只需检验到 n 的平方根为止的候选者。<sup>[8](https://www.math.columbia.edu/department/rama/chapters/chap2.html)</sup>

关系 d | n 是正整数上的一个偏序。在此序下，固定整数 n 的全体除数构成一个格，其中两个除数的交是它们的最大公约数，并是它们的最小公倍数；这一格结构还是分配格。<sup>[9](https://www.math.colostate.edu/~hulpke/lectures/m501/notes.html)</sup>

## 素数与唯一分解

素数由除数个数来定义。自然数 p 是素数，当且仅当它恰有两个正除数：1 和 p；数 1 只有一个正除数，因此不是素数，而大于 1 且不是素数的整数称为合数，1 和负整数则不是合数。<sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup><sup> • </sup><sup>[1](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)</sup><sup> • </sup><sup>[15](https://math-sites.uncg.edu/sites/pauli/112/HTML/secprimedef.html)</sup> 对素数 p 和任意整数 a，以下两件事恰有一件成立：p 整除 a，或者 a 与 p 互素。<sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup>

所有整数的除数结构由算术基本定理组织起来：每个大于 1 的整数要么是素数，要么是两个或更多素数的乘积，且在不计因子次序的意义下分解唯一。<sup>[1](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)</sup><sup> • </sup><sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup> 唯一性证明的关键一步是欧几里得引理：若 p 是素数且 p 整除乘积 ab，则 p 至少整除其中一个因子。<sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup> 一旦把一个数写成素数幂的乘积，它的除数便可直接读出：一个除数是这样的乘积，其中每个素数的幂次介于 0 与该素数在 n 中的指数之间。

## 最大公约数与欧几里得算法

a 与 b 的**最大公约数**记作 gcd(a, b)，是同时整除两者的最大正整数。<sup>[3](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup> 当 gcd 为 1 时，称这两个数互素。<sup>[3](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup> 一个用扩展欧几里得算法证明的核心结构事实是贝祖恒等式：对正整数 a 和 b，总存在整数 u 和 v 使 au + bv = gcd(a, b)。<sup>[4](https://math.mit.edu/research/highschool/primes/circle/documents/2024/Honglin.pdf)</sup> 一个推论便是欧几里得引理本身：若 c 整除 ab 且 c 与 b 互素，则 c 整除 a。<sup>[2](https://www.math.drexel.edu/~tolya/gcd.pdf)</sup>

欧几里得算法无需分解两数即可计算 gcd。它依据的观察是：若 a = bq + r 且 0 ≤ r < b，则 a 与 b 的任何公约数也整除 r，因此数对 (a, b) 与 (b, r) 的公约数完全相同，且 gcd(a, b) = gcd(b, r)。<sup>[4](https://math.mit.edu/research/highschool/primes/circle/documents/2024/Honglin.pdf)</sup> 把数对 (a, b) 换成 (b, r) 并重复，余数严格递减，直到某个余数为零；最后一个非零余数就是 gcd。<sup>[10](https://math.berkeley.edu/~giventh/DM.pdf)</sup> 例如 gcd(91, 14) = gcd(14, 7) = 7，因为 91 与 14 的任何公约数也整除 91 − 14 · 6 = 7。<sup>[11](https://gulf.edu.sa/assets/lib/cs/discrete-mathematics.pdf)</sup> 用二进制来衡量，该算法运行 O(n) 个阶段，其中 n 是 a 与 b 的二进制表示的总长度，每阶段至多计算一次余数。<sup>[7](https://zoo.cs.yale.edu/classes/cs467/2006f/attach/ln08.html)</sup>

另一种做法是从 a 与 b 的素因数分解出发，对每个素数取最小指数来求 gcd，这虽然正确却低效，因为它要求先分解两个数。<sup>[11](https://gulf.edu.sa/assets/lib/cs/discrete-mathematics.pdf)</sup> 这一差距在实践中很重要：分解被认为是一个困难问题，目前未知任何多项式时间的分解算法，而欧几里得算法很快。<sup>[7](https://zoo.cs.yale.edu/classes/cs467/2006f/attach/ln08.html)</sup>

## 除数计数

**除数函数** τ(n) 计算 n 的正除数个数。它从一个整数到下一个整数的行为并不规则，但其平均值已被充分理解：从 1 到 x 的所有整数的除数总数为

\[ \sum_{n \le x} \tau(n) = x \log x + (2\gamma - 1)x + O(x^{\theta}) \]

其中 θ < 1，γ 是欧拉–马歇罗尼常数，因此 x 附近整数的除数平均个数按 log x 增长。<sup>[6](https://webhomes.maths.ed.ac.uk/~chris/NTh/Number_Theory_Notes2012.pdf)</sup>

## 历史注记

对除数的系统研究始于约公元前 300 年写成的欧几里得《几何原本》。作为一部自足的著作，第七卷是研究数的入口，其中包含欧几里得算法——在那里被称为求最大公度——用以确定一对数的最大公约数。<sup>[5](https://mathshistory.st-andrews.ac.uk//Biographies/Euclid/)</sup><sup> • </sup><sup>[12](https://www.math.clemson.edu/~macaule/classes/m14_math4120/m14_math4120_lecture-14_h.pdf)</sup> 第九卷证明了素数有无穷多个。<sup>[13](https://mathshistory.st-andrews.ac.uk/HistTopics/Prime_numbers/)</sup>

毕达哥拉斯学派（公元前 500 年至公元前 300 年）已通过完全数研究除数，完全数定义为等于其真除数之和的数：6 = 1 + 2 + 3，28 = 1 + 2 + 4 + 7 + 14。6、28、496、8128 这四个完全数自古以来便已为人所知，欧几里得《几何原本》载有这一结果：若 2<sup>n</sup> − 1 是素数，则 2<sup>n−1</sup>(2<sup>n</sup> − 1) 是完全数。<sup>[13](https://mathshistory.st-andrews.ac.uk/HistTopics/Prime_numbers/)</sup><sup> • </sup><sup>[14](https://mathshistory.st-andrews.ac.uk/HistTopics/Perfect_numbers/)</sup> 后来的初等分解方法，如试除法和费马分解法，也直接利用除数的结构。<sup>[8](https://www.math.columbia.edu/department/rama/chapters/chap2.html)</sup>

## References

1. [4.2. Greatest Common Divisors and Primes, Discrete Structures for Computing (Western University)](https://www.csd.uwo.ca/~abrandt5/teaching/DiscreteStructures/Chapter4/gcds-and-primes.html)
2. [Notes on the Euclidean Algorithm (Drexel University)](https://www.math.drexel.edu/~tolya/gcd.pdf)
3. [Section 9.5 Greatest divisors, Bézout and the Euclidean algorithm (University of British Columbia)](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)
4. [The RSA Cryptosystem (MIT PRIMES Circle)](https://math.mit.edu/research/highschool/primes/circle/documents/2024/Honglin.pdf)
5. [Euclid (325 BC – 265 BC), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk//Biographies/Euclid/)
6. [Maths 4 Number Theory Notes 2012 (University of Edinburgh)](https://webhomes.maths.ed.ac.uk/~chris/NTh/Number_Theory_Notes2012.pdf)
7. [Notes on number theory, CS 467 (Yale University)](https://zoo.cs.yale.edu/classes/cs467/2006f/attach/ln08.html)
8. [Chapter 2. Divisibility and Primes (Columbia University)](https://www.math.columbia.edu/department/rama/chapters/chap2.html)
9. [Combinatorics lecture notes (Colorado State University)](https://www.math.colostate.edu/~hulpke/lectures/m501/notes.html)
10. [Number theory notes (University of California, Berkeley)](https://math.berkeley.edu/~giventh/DM.pdf)
11. [Discrete Mathematics course text (Gulf University)](https://gulf.edu.sa/assets/lib/cs/discrete-mathematics.pdf)
12. [Chapter 14: Divisibility and factorization (Clemson University)](https://www.math.clemson.edu/~macaule/classes/m14_math4120/m14_math4120_lecture-14_h.pdf)
13. [Prime numbers, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Prime_numbers/)
14. [Perfect numbers, MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/HistTopics/Perfect_numbers/)
15. [math-sites.uncg.edu](https://math-sites.uncg.edu/sites/pauli/112/HTML/secprimedef.html)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; 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/divisor

English original: https://www.edgepedia.org/divisor
