# 最小公倍数

两个非零整数的最小公倍数（LCM）是二者都能整除的最小正整数；例如，lcm(6, 9) = 18。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup><sup> • </sup><sup>[2](https://csrc.nist.gov/glossary/term/least_common_multiple)</sup> 在整除序下，它与最大公约数（GCD）互为对偶；二者由一个简单的乘积公式联系起来，一旦知道 GCD，LCM 就容易计算。<sup>[3](https://math.libretexts.org/Courses/Mount_Royal_University/Abstract_Algebra_I/Chapter_1%3A_Integers/1.2%3A_Greatest_common_divisor_and_least_common_multiple)</sup>

| 要点 | 说明 |
|---|---|
| 定义 | 对于非零整数 \( a, b \)，lcm(a, b) 是正公倍数集合中的最小元素；该集合非空，因为它包含 \( \|ab\| \)<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> |
| 乘积公式 | \( \gcd(a,b) \cdot \operatorname{lcm}(a,b) = \|ab\| \)，因此 \( \operatorname{lcm}(a,b) = \|ab\| / \gcd(a,b) \)<sup>[3](https://math.libretexts.org/Courses/Mount_Royal_University/Abstract_Algebra_I/Chapter_1%3A_Integers/1.2%3A_Greatest_common_divisor_and_least_common_multiple)</sup> |
| 整除作用 | \( a \) 与 \( b \) 的每个公倍数都是 lcm(a, b) 的倍数<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> |
| 例 | lcm(18, 30) = 18 · 30 / 6 = 90，因为 gcd(18, 30) = 6<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> |
| 零的情形 | 对于非零 \( a \)，在标准定义中 lcm(a, 0) 没有良好定义，因为唯一的公倍数是 0；某些语境（包括 C++17 的 std::lcm 和 Python 的 math.lcm）将其定义为 0<sup>[4](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup><sup> • </sup><sup>[5](https://en.cppreference.com/cpp/numeric/lcm)</sup><sup> • </sup><sup>[6](https://docs.python.org/3/library/math.html)</sup> |
| 英语中首次出现 | 1734 年，亚历山大·赖特（Alexander Wright）的《分数论，两部分》<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathword/l/)</sup> |
| 课程安排 | 共同核心标准六年级：求两个小于或等于 12 的整数的 LCM<sup>[8](https://www.khanacademy.org/standards/CCSS.Math/6.NS)</sup> |

## 定义与基本性质

如果 \( a \mid c \) 且 \( b \mid c \)，则整数 \( c \) 是 \( a \) 与 \( b \) 的公倍数。对于 \( a = 6 \) 和 \( b = 9 \)，倍数分别是 \( \{0, \pm 6, \pm 12, \pm 18, \dots\} \) 和 \( \{0, \pm 9, \pm 18, \pm 27, \dots\} \)，其交集为 \( \{0, \pm 18, \pm 36, \dots\} \)；其中最小的正元素是 18。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> 对于非零的 \( a \) 和 \( b \)，正公倍数集合从不为空，因为 \( \|ab\| \) 属于其中，所以最小元素存在，配得上 lcm 之名。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup>

两个结构性事实使 LCM 不仅仅是一个猎奇对象。第一，\( a \) 与 \( b \) 的公倍数恰好是 lcm(a, b) 的倍数，正如它们的公约数恰好是 gcd(a, b) 的约数。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> 第二，把 \( a \) 或 \( b \) 换成其相反数不会改变任何东西，因为公倍数集合不变；lcm(−18, 30) = lcm(18, −30) = 90。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> 该运算也是对称的，\( \operatorname{lcm}(a,b) = \operatorname{lcm}(b,a) \)。<sup>[4](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup>

零的情形需要小心。由于对任意 \( n \) 都有 \( 0 \times n = 0 \)，\( a \) 与 0 的唯一公倍数是 0，而通常定义要求最小的*正*公倍数，因此不适用；不过某些语境仍定义 lcm(a, 0) = 0。<sup>[4](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup> 软件库正是走这条路：C++17 的 std::lcm 在任一参数为零时返回零，Python 的 math.lcm 在任一参数为零时返回 0。<sup>[5](https://en.cppreference.com/cpp/numeric/lcm)</sup><sup> • </sup><sup>[6](https://docs.python.org/3/library/math.html)</sup>

## 计算 LCM

**借助 GCD。** 核心恒等式是：对于正整数，\( \gcd(a,b) \cdot \operatorname{lcm}(a,b) = \|ab\| \)，等价地 \( \operatorname{lcm}(a,b) = \|ab\| / \gcd(a,b) \)。<sup>[3](https://math.libretexts.org/Courses/Mount_Royal_University/Abstract_Algebra_I/Chapter_1%3A_Integers/1.2%3A_Greatest_common_divisor_and_least_common_multiple)</sup> 例如，gcd(18, 30) = 6，所以 lcm(18, 30) = 18 · 30 / 6 = 90。<sup>[1](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)</sup> 当 \( a \) 与 \( b \) 没有公因子时，gcd(a, b) = 1，LCM 就是它们的乘积；lcm(24, 35) = 840。<sup>[3](https://math.libretexts.org/Courses/Mount_Royal_University/Abstract_Algebra_I/Chapter_1%3A_Integers/1.2%3A_Greatest_common_divisor_and_least_common_multiple)</sup> 由于 GCD 可以用欧几里得算法快速计算，这条路线完全避免了分解因数；对于素因数分解困难的大整数，这一点很重要。<sup>[9](https://mfleck.cs.illinois.edu/building-blocks/version-1.2/number-theory.pdf)</sup>

**借助素因数分解。** 把每个数分解为素数，将公共素数按列对齐，然后取两个数中每个素因子的最高次幂相乘。对于 12 = 2 · 2 · 3 和 18 = 2 · 3 · 3，LCM 是 2 · 2 · 3 · 3 = 36。<sup>[10](https://openstax.org/books/prealgebra-2e/pages/4-5-add-and-subtract-fractions-with-different-denominators)</sup> 列举法适用于较小的数：写出每个数的前几个倍数，取两张列表中都出现的最小值；对于 15 和 20，该值是 60，而 120 是公倍数但不是最小公倍数。<sup>[11](https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple)</sup>

**多于两个数。** 这一概念可推广到任意有限个整数，恒等式通过两两配对推广：\( \operatorname{lcm}(a,b,c) = \operatorname{lcm}(\operatorname{lcm}(a,b), c) \)。<sup>[12](https://beta.fermi.ai/math/least-common-multiple)</sup> Python 的 math.lcm 接受任意数量的参数，返回所有参数的最小正公倍数；无参数调用时返回 1。<sup>[6](https://docs.python.org/3/library/math.html)</sup> MATLAB 的 lcm 函数同样返回两个数组的逐元素最小公倍数。<sup>[13](https://www.mathworks.com/help/matlab/ref/lcm.html)</sup>

## 用途

**分数。** 最熟悉的课堂用途是分数的最小公分母（LCD），它定义为其分母的 LCM；对于 \( \frac{1}{2} \) 和 \( \frac{1}{3} \)，LCD 是 6；对于 \( \frac{7}{12} \) 和 \( \frac{5}{18} \)，LCD 是 36。<sup>[10](https://openstax.org/books/prealgebra-2e/pages/4-5-add-and-subtract-fractions-with-different-denominators)</sup> 同样的想法可延伸到代数中的有理式，其中 LCD 保留为因式形式。<sup>[14](https://openstax.org/books/elementary-algebra/pages/8-4-add-and-subtract-rational-expressions-with-unlike-denominators)</sup>

**同余。** 在模算术中，若 \( a \equiv b \pmod{m} \) 且 \( a \equiv b \pmod{n} \)，则 \( a \equiv b \pmod{\operatorname{lcm}(m,n)} \)，因此 LCM 决定了两个同余式何时同时成立。<sup>[15](https://assets.press.princeton.edu/chapters/s8220.pdf)</sup> 历史上，这种联系非常深刻：在中国传统数学中，早在公元一世纪初就出现了更相减损术，用于求整数的最大公因数和最小公倍数、计算分数周期的公共周期，以及求解一次同余式与不定方程。<sup>[16](https://www.sciencedirect.com/science/article/pii/0315086088900031)</sup>

**周期现象。** 由于 LCM 度量两个周期首次重新对齐的位置，它构成了数学与科学中循环与周期现象的基础。<sup>[12](https://beta.fermi.ai/math/least-common-multiple)</sup> 在抽象代数中，这对运算本身就是结构：\( (\mathbb{N}, \operatorname{lcm}, \gcd, 1, 0) \) 构成一个有界格。<sup>[17](https://www.cl.cam.ac.uk/teaching/2122/DiscMath/DiscMathSummaryNotes.pdf)</sup> 基于整除的定义甚至能超越整数，扩展到没有自然序的语境，例如高斯整数环。<sup>[18](https://ncatlab.org/nlab/show/least%2Bcommon%2Bmultiple)</sup>

## 术语史

英语短语“least common multiple”最早记录于 1734 年亚历山大·赖特（Alexander Wright）的《分数论，两部分》，该书将其定义为“被所提出的每个数除尽而不留余数的最小数”，并举例说 12 是 2、3、4 和 6 的最小公倍数。<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathword/l/)</sup> “最小公分母”于 1751 年出现在埃德蒙·温盖特（Edmund Wingate）的算术著作中，“最低公倍数”于 1830 年出现在乔治·皮科克（George Peacock）的《代数论》中。<sup>[7](https://mathshistory.st-andrews.ac.uk/Miller/mathword/l/)</sup> 缩写 gcd 和 lcm 现已成为文献中的标准写法。<sup>[4](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)</sup>

## LCM 在课程标准与研究中的位置

LCM 在数学课程中出现得很早。共同核心标准（Common Core）要求六年级学生求两个不超过 100 的整数的最大公因数，以及两个小于或等于 12 的整数的最小公倍数。<sup>[8](https://www.khanacademy.org/standards/CCSS.Math/6.NS)</sup> 不列颠哥伦比亚省（British Columbia）的六年级课程把最大公因数和最小公倍数列入内容标准，并用维恩图等工具比较公因数与公倍数来教学。<sup>[19](https://www.curriculum.gov.bc.ca/curriculum/mathematics/6/core)</sup> ACT 数学标准在 N 503 级别包含“求并使用最小公倍数”。<sup>[20](https://www.act.org/content/act/en/college-and-career-readiness/standards/mathematics-standards.html)</sup>

在研究层面，有结构序列的 LCM 是一个活跃的研究对象。对于斐波那契数列，已知当 \( n \to \infty \) 时，\( \log \operatorname{lcm}(F_n, F_{n+1}, \dots, F_{n+m}) \sim n(m+1)\log\Phi \)，其中 \( \Phi \) 是黄金比例。<sup>[21](https://arxiv.org/abs/2011.03858)</sup> 相关工作研究连续整数与等差数列项的 LCM，以及 \( \operatorname{lcm}(n_1, \dots, n_k) \) 在整数盒上的平均值。<sup>[22](https://arxiv.org/abs/0808.1507)</sup><sup> • </sup><sup>[23](https://arxiv.org/abs/1604.04508)</sup>

## References

1. [MATH111: Numbers and Relations, §4.5 Lowest common multiples, Lancaster University](https://www.lancaster.ac.uk/~prendivs/accessible/math111/doth4.S5.html)
2. [Least common multiple, NIST CSRC Glossary](https://csrc.nist.gov/glossary/term/least_common_multiple)
3. [1.2: Greatest common divisor and least common multiple, Mathematics LibreTexts (Mount Royal University)](https://math.libretexts.org/Courses/Mount_Royal_University/Abstract_Algebra_I/Chapter_1%3A_Integers/1.2%3A_Greatest_common_divisor_and_least_common_multiple)
4. [Greatest divisors, Bézout and the Euclidean algorithm, University of British Columbia](https://personal.math.ubc.ca/~PLP/book/sec-euclid.html)
5. [std::lcm, cppreference.com](https://en.cppreference.com/cpp/numeric/lcm)
6. [math — Mathematical functions, Python 3 documentation](https://docs.python.org/3/library/math.html)
7. [Earliest Known Uses of Some of the Words of Mathematics (L), MacTutor History of Mathematics](https://mathshistory.st-andrews.ac.uk/Miller/mathword/l/)
8. [Standards Mapping, Common Core Math 6.NS, Khan Academy](https://www.khanacademy.org/standards/CCSS.Math/6.NS)
9. [Number Theory (Building Blocks), University of Illinois](https://mfleck.cs.illinois.edu/building-blocks/version-1.2/number-theory.pdf)
10. [4.5 Add and Subtract Fractions with Different Denominators, Prealgebra 2e, OpenStax](https://openstax.org/books/prealgebra-2e/pages/4-5-add-and-subtract-fractions-with-different-denominators)
11. [2.5 Prime Factorization and the Least Common Multiple, Prealgebra 2e, OpenStax](https://openstax.org/books/prealgebra-2e/pages/2-5-prime-factorization-and-the-least-common-multiple)
12. [Least Common Multiple, Fermi Mathematics](https://beta.fermi.ai/math/least-common-multiple)
13. [lcm, MATLAB documentation, MathWorks](https://www.mathworks.com/help/matlab/ref/lcm.html)
14. [8.4 Add and Subtract Rational Expressions with Unlike Denominators, Elementary Algebra, OpenStax](https://openstax.org/books/elementary-algebra/pages/8-4-add-and-subtract-rational-expressions-with-unlike-denominators)
15. [Mod p Arithmetic, Group Theory and Cryptography, Princeton University Press](https://assets.press.princeton.edu/chapters/s8220.pdf)
16. [Shen Kangsheng (1988). Mutual-subtraction algorithm and its applications in ancient China. Historia Mathematica 15(2), 135–147.](https://www.sciencedirect.com/science/article/pii/0315086088900031)
17. [Discrete Mathematics summary notes, University of Cambridge Computer Laboratory](https://www.cl.cam.ac.uk/teaching/2122/DiscMath/DiscMathSummaryNotes.pdf)
18. [Least common multiple, nLab](https://ncatlab.org/nlab/show/least%2Bcommon%2Bmultiple)
19. [Building Student Success, British Columbia Curriculum, Mathematics 6](https://www.curriculum.gov.bc.ca/curriculum/mathematics/6/core)
20. [ACT Mathematics Standards](https://www.act.org/content/act/en/college-and-career-readiness/standards/mathematics-standards.html)
21. [On the least common multiple of binary linear recurrence sequences, arXiv:2011.03858](https://arxiv.org/abs/2011.03858)
22. [New results on the least common multiple of consecutive integers, arXiv:0808.1507](https://arxiv.org/abs/0808.1507)
23. [On the average value of the least common multiple of k positive integers, arXiv:1604.04508](https://arxiv.org/abs/1604.04508)

---
*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/least-common-multiple

English original: https://www.edgepedia.org/least-common-multiple
