edgepedia

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

综合 · Edgepedia阅读需 7 分钟

最小公倍数

阅读英文原文

两个非零整数的最小公倍数(LCM)是二者都能整除的最小正整数;例如,lcm(6, 9) = 18。1 • 2 在整除序下,它与最大公约数(GCD)互为对偶;二者由一个简单的乘积公式联系起来,一旦知道 GCD,LCM 就容易计算。3

要点说明
定义对于非零整数 a,b a, b ,lcm(a, b) 是正公倍数集合中的最小元素;该集合非空,因为它包含 ∥ab∥ \|ab\| 1
乘积公式gcd⁡(a,b)⋅lcm⁡(a,b)=∥ab∥ \gcd(a,b) \cdot \operatorname{lcm}(a,b) = \|ab\| ,因此 lcm⁡(a,b)=∥ab∥/gcd⁡(a,b) \operatorname{lcm}(a,b) = \|ab\| / \gcd(a,b) 3
整除作用a a 与 b b 的每个公倍数都是 lcm(a, b) 的倍数1
例lcm(18, 30) = 18 · 30 / 6 = 90,因为 gcd(18, 30) = 61
零的情形对于非零 a a ,在标准定义中 lcm(a, 0) 没有良好定义,因为唯一的公倍数是 0;某些语境(包括 C++17 的 std::lcm 和 Python 的 math.lcm)将其定义为 04 • 5 • 6
英语中首次出现1734 年,亚历山大·赖特(Alexander Wright)的《分数论,两部分》7
课程安排共同核心标准六年级:求两个小于或等于 12 的整数的 LCM8

定义与基本性质

如果 a∣c a \mid c 且 b∣c b \mid c ,则整数 c c 是 a a 与 b b 的公倍数。对于 a=6 a = 6 和 b=9 b = 9 ,倍数分别是 {0,±6,±12,±18,… } \{0, \pm 6, \pm 12, \pm 18, \dots\} 和 {0,±9,±18,±27,… } \{0, \pm 9, \pm 18, \pm 27, \dots\} ,其交集为 {0,±18,±36,… } \{0, \pm 18, \pm 36, \dots\} ;其中最小的正元素是 18。1 对于非零的 a a 和 b b ,正公倍数集合从不为空,因为 ∥ab∥ \|ab\| 属于其中,所以最小元素存在,配得上 lcm 之名。1

两个结构性事实使 LCM 不仅仅是一个猎奇对象。第一,a a 与 b b 的公倍数恰好是 lcm(a, b) 的倍数,正如它们的公约数恰好是 gcd(a, b) 的约数。1 第二,把 a a 或 b b 换成其相反数不会改变任何东西,因为公倍数集合不变;lcm(−18, 30) = lcm(18, −30) = 90。1 该运算也是对称的,lcm⁡(a,b)=lcm⁡(b,a) \operatorname{lcm}(a,b) = \operatorname{lcm}(b,a) 。4

零的情形需要小心。由于对任意 n n 都有 0×n=0 0 \times n = 0 ,a a 与 0 的唯一公倍数是 0,而通常定义要求最小的正公倍数,因此不适用;不过某些语境仍定义 lcm(a, 0) = 0。4 软件库正是走这条路:C++17 的 std::lcm 在任一参数为零时返回零,Python 的 math.lcm 在任一参数为零时返回 0。5 • 6

计算 LCM

借助 GCD。 核心恒等式是:对于正整数,gcd⁡(a,b)⋅lcm⁡(a,b)=∥ab∥ \gcd(a,b) \cdot \operatorname{lcm}(a,b) = \|ab\| ,等价地 lcm⁡(a,b)=∥ab∥/gcd⁡(a,b) \operatorname{lcm}(a,b) = \|ab\| / \gcd(a,b) 。3 例如,gcd(18, 30) = 6,所以 lcm(18, 30) = 18 · 30 / 6 = 90。1 当 a a 与 b b 没有公因子时,gcd(a, b) = 1,LCM 就是它们的乘积;lcm(24, 35) = 840。3 由于 GCD 可以用欧几里得算法快速计算,这条路线完全避免了分解因数;对于素因数分解困难的大整数,这一点很重要。9

借助素因数分解。 把每个数分解为素数,将公共素数按列对齐,然后取两个数中每个素因子的最高次幂相乘。对于 12 = 2 · 2 · 3 和 18 = 2 · 3 · 3,LCM 是 2 · 2 · 3 · 3 = 36。10 列举法适用于较小的数:写出每个数的前几个倍数,取两张列表中都出现的最小值;对于 15 和 20,该值是 60,而 120 是公倍数但不是最小公倍数。11

多于两个数。 这一概念可推广到任意有限个整数,恒等式通过两两配对推广:lcm⁡(a,b,c)=lcm⁡(lcm⁡(a,b),c) \operatorname{lcm}(a,b,c) = \operatorname{lcm}(\operatorname{lcm}(a,b), c) 。12 Python 的 math.lcm 接受任意数量的参数,返回所有参数的最小正公倍数;无参数调用时返回 1。6 MATLAB 的 lcm 函数同样返回两个数组的逐元素最小公倍数。13

用途

分数。 最熟悉的课堂用途是分数的最小公分母(LCD),它定义为其分母的 LCM;对于 12 \frac{1}{2} 和 13 \frac{1}{3} ,LCD 是 6;对于 712 \frac{7}{12} 和 518 \frac{5}{18} ,LCD 是 36。10 同样的想法可延伸到代数中的有理式,其中 LCD 保留为因式形式。14

同余。 在模算术中,若 a≡b(modm) a \equiv b \pmod{m} 且 a≡b(modn) a \equiv b \pmod{n} ,则 a≡b(modlcm⁡(m,n)) a \equiv b \pmod{\operatorname{lcm}(m,n)} ,因此 LCM 决定了两个同余式何时同时成立。15 历史上,这种联系非常深刻:在中国传统数学中,早在公元一世纪初就出现了更相减损术,用于求整数的最大公因数和最小公倍数、计算分数周期的公共周期,以及求解一次同余式与不定方程。16

周期现象。 由于 LCM 度量两个周期首次重新对齐的位置,它构成了数学与科学中循环与周期现象的基础。12 在抽象代数中,这对运算本身就是结构:(N,lcm⁡,gcd⁡,1,0) (\mathbb{N}, \operatorname{lcm}, \gcd, 1, 0) 构成一个有界格。17 基于整除的定义甚至能超越整数,扩展到没有自然序的语境,例如高斯整数环。18

术语史

英语短语“least common multiple”最早记录于 1734 年亚历山大·赖特(Alexander Wright)的《分数论,两部分》,该书将其定义为“被所提出的每个数除尽而不留余数的最小数”,并举例说 12 是 2、3、4 和 6 的最小公倍数。7 “最小公分母”于 1751 年出现在埃德蒙·温盖特(Edmund Wingate)的算术著作中,“最低公倍数”于 1830 年出现在乔治·皮科克(George Peacock)的《代数论》中。7 缩写 gcd 和 lcm 现已成为文献中的标准写法。4

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

LCM 在数学课程中出现得很早。共同核心标准(Common Core)要求六年级学生求两个不超过 100 的整数的最大公因数,以及两个小于或等于 12 的整数的最小公倍数。8 不列颠哥伦比亚省(British Columbia)的六年级课程把最大公因数和最小公倍数列入内容标准,并用维恩图等工具比较公因数与公倍数来教学。19 ACT 数学标准在 N 503 级别包含“求并使用最小公倍数”。20

在研究层面,有结构序列的 LCM 是一个活跃的研究对象。对于斐波那契数列,已知当 n→∞ n \to \infty 时,log⁡lcm⁡(Fn,Fn+1,…,Fn+m)∼n(m+1)log⁡Φ \log \operatorname{lcm}(F_n, F_{n+1}, \dots, F_{n+m}) \sim n(m+1)\log\Phi ,其中 Φ \Phi 是黄金比例。21 相关工作研究连续整数与等差数列项的 LCM,以及 lcm⁡(n1,…,nk) \operatorname{lcm}(n_1, \dots, n_k) 在整数盒上的平均值。22 • 23

References

  1. MATH111: Numbers and Relations, §4.5 Lowest common multiples, Lancaster University
  2. Least common multiple, NIST CSRC Glossary
  3. 1.2: Greatest common divisor and least common multiple, Mathematics LibreTexts (Mount Royal University)
  4. Greatest divisors, Bézout and the Euclidean algorithm, University of British Columbia
  5. std::lcm, cppreference.com
  6. math — Mathematical functions, Python 3 documentation
  7. Earliest Known Uses of Some of the Words of Mathematics (L), MacTutor History of Mathematics
  8. Standards Mapping, Common Core Math 6.NS, Khan Academy
  9. Number Theory (Building Blocks), University of Illinois
  10. 4.5 Add and Subtract Fractions with Different Denominators, Prealgebra 2e, OpenStax
  11. 2.5 Prime Factorization and the Least Common Multiple, Prealgebra 2e, OpenStax
  12. Least Common Multiple, Fermi Mathematics
  13. lcm, MATLAB documentation, MathWorks
  14. 8.4 Add and Subtract Rational Expressions with Unlike Denominators, Elementary Algebra, OpenStax
  15. Mod p Arithmetic, Group Theory and Cryptography, Princeton University Press
  16. Shen Kangsheng (1988). Mutual-subtraction algorithm and its applications in ancient China. Historia Mathematica 15(2), 135–147.
  17. Discrete Mathematics summary notes, University of Cambridge Computer Laboratory
  18. Least common multiple, nLab
  19. Building Student Success, British Columbia Curriculum, Mathematics 6
  20. ACT Mathematics Standards
  21. On the least common multiple of binary linear recurrence sequences, arXiv:2011.03858
  22. New results on the least common multiple of consecutive integers, arXiv:0808.1507
  23. On the average value of the least common multiple of k positive integers, arXiv:1604.04508

Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Sep 30, 2026; Oct 15, 2026

© 2026 Biostate AI。依据 Edgepedia Community License,注明出处即可免费使用。 嵌入参考卡片。

报告错误

最小公倍数

请至少选择一个原因。