# 卡迈克尔数

卡迈克尔数（Carmichael number）是合数 n，它对所有与 n 互素的底数都满足费马小定理，即对每个满足 gcd(b, n) = 1 的整数 b，都有 b^(n−1) ≡ 1 (mod n)<sup>[1](https://antsmath.org/ANTSVIII/files/pinch.pdf)</sup>。由于直接建立在费马小定理之上的素性检验无法将这些合数与素数区分开来，它们便成了费马式素性检验的经典障碍，也正是它们促使人们提出了更强的米勒-拉宾检验——后者不存在类似卡迈克尔数的对应物<sup>[10](https://crypto.stanford.edu/pbc/notes/numbertheory/millerrabin.html)</sup><sup> • </sup><sup>[3](https://math.gordon.edu/ntic/ntic/section-strong-pseudoprime.html)</sup>。

| 关键事实 | 细节 |
|---|---|
| 定义 | 合数 n，对每个与 n 互素的 b 都有 b^(n−1) ≡ 1 (mod n)<sup>[1](https://antsmath.org/ANTSVIII/files/pinch.pdf)</sup> |
| 科塞尔特判别法 | n 是卡迈克尔数当且仅当 n 无平方因子，且对 n 的每个素因子 p，p − 1 都整除 n − 1；这样的 n 至少有三个素因子<sup>[1](https://antsmath.org/ANTSVIII/files/pinch.pdf)</sup> |
| 最小的例子 | 561 = 3 × 11 × 17，其中 2、10、16 都整除 560<sup>[4](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)</sup><sup> • </sup><sup>[5](https://archive.nptel.ac.in/content/storage2/courses/106103015/module8/lec2/2.html)</sup> |
| 无穷性 | 由 W. R. 阿尔福德（W. R. Alford）、安德鲁·格兰维尔（Andrew Granville）和卡尔·波梅兰斯（Carl Pomerance）证明，《数学年刊》139 (1994)，703–722<sup>[6](https://annals.math.princeton.edu/1994/193-3/p06)</sup> |
| 计数下界 | 对充分大的 x，不超过 x 的卡迈克尔数个数 C(x) 超过 x^(2/7)<sup>[7](https://citeseerx.ist.psu.edu/document?doi=4b32f6405e241049bae2265187eaab82fe6c6042&repid=rep1&type=pdf)</sup> |
| 与米勒-拉宾的对比 | 奇合数 n 在 1 到 n − 1 之间至多对 (n − 1)/4 个底数通过米勒检验，因此不存在“强卡迈克尔数”<sup>[3](https://math.gordon.edu/ntic/ntic/section-strong-pseudoprime.html)</sup> |
| 制表 | 理查德·平奇（Richard Pinch）编制了 10^21 以内所有卡迈克尔数的表；2024 年的一个项目将精确计数扩展到了 10^22<sup>[8](https://link.springer.com/article/10.1007/s40993-024-00598-3)</sup> |

## 定义与科塞尔特判别法

费马检验随机选取一个底数 a，检查是否有 a^(n−1) ≡ 1 (mod n)；若不成立，就证明 n 是合数。对大多数合数而言，许多底数都会检验失败，但卡迈克尔数对每个与 n 互素的底数都能通过。费马检验能识破卡迈克尔数的唯一情形，是所选的 a 恰好与 n 有公因子；而当 n 的所有素因子都很大时，随机选到这样的 a 的可能性微乎其微<sup>[9](https://ocw.mit.edu/courses/18-310-principles-of-discrete-applied-mathematics-fall-2013/9e96bf48fb5d12f1300365d05e227be1_MIT18_310F13_Ch15.pdf)</sup>。

结构性的刻画是科塞尔特判别法：正整数合数 n 是卡迈克尔数当且仅当 n 无平方因子，且对 n 的每个素因子 p，p − 1 都整除 n − 1<sup>[5](https://archive.nptel.ac.in/content/storage2/courses/106103015/module8/lec2/2.html)</sup><sup> • </sup><sup>[1](https://antsmath.org/ANTSVIII/files/pinch.pdf)</sup>。由此可得两个推论。卡迈克尔数不可能是两个不同素数的乘积：若 n = pq 且 p > q，由于 gcd(p − 1, q − 1) 至多为 (p − 1)/2，能骗过费马检验的底数 a 至多占所有可能底数的一半<sup>[2](https://crypto.stanford.edu/pbc/notes/numbertheory/carmichael.html)</sup>。它也不能含有素数的平方因子：若 n = p^k r 且 k ≥ 2，则 n 通过费马检验的概率至多为 1/4。因此，每个卡迈克尔数都无平方因子，且至少有三个不同的素因子<sup>[2](https://crypto.stanford.edu/pbc/notes/numbertheory/carmichael.html)</sup>。

最小的几个例子展示了该判别法的运作。561 = 3 × 11 × 17 无平方因子，且 2、10、16 各自整除 560<sup>[5](https://archive.nptel.ac.in/content/storage2/courses/106103015/module8/lec2/2.html)</sup>。接下来是 1105 = 5 × 13 × 17，其中 4、12、16 整除 1104<sup>[5](https://archive.nptel.ac.in/content/storage2/courses/106103015/module8/lec2/2.html)</sup>，然后是 1729<sup>[10](https://crypto.stanford.edu/pbc/notes/numbertheory/millerrabin.html)</sup>。直接计数可得，10^7 以下有 105 个卡迈克尔数<sup>[11](https://www.matpic.com/essays/the-numbers-that-fool-every-base/)</sup>。

## 历史

尽管瓦茨拉夫·希梅尔卡（Václav Šimerka）在 1885 年就发现了最初的七个卡迈克尔数，罗伯特·D·卡迈克尔（Robert D. Carmichael）却在 1910 年独立地注意到了这些数；他算出了 15 个实例，并提出猜想：这样的数有无穷多个<sup>[12](https://archive.lib.msu.edu/crcmath/math/math/c/c060.htm)</sup><sup> • </sup><sup>[19](https://www.cambridge.org/core/services/aop-cambridge-core/content/view/E732DD46A7CF3D0EE22BB21D16D72645/S000497271900145Xa.pdf/div-class-title-a-conditional-density-for-carmichael-numbers-div.pdf)</sup>。他的论文《论满足费马同余式 a^(P−1) ≡ 1 mod P 的合数 P》发表于《美国数学月刊》第 19 卷第 2 期（1912 年 2 月），第 22–27 页<sup>[13](https://www.jstor.org/stable/2972687)</sup>。在后来的工作中，卡迈克尔给出了构造这类数的一种算法，并称这份列表“可以无限地扩展下去”，但八十多年间无人能证明其无穷性，尽管人们早已觉得这很可能<sup>[14](https://math.dartmouth.edu/~carlp/PDF/paper95.pdf)</sup>。

证明出现在 1994 年，W. R. 阿尔福德、安德鲁·格兰维尔和卡尔·波梅兰斯在《数学年刊》上发表了《卡迈克尔数有无穷多个》<sup>[6](https://annals.math.princeton.edu/1994/193-3/p06)</sup>。他们的论证建立在保罗·埃尔德什（Paul Erdős）的一个启发式想法之上，并且证明的不止是无穷性：对充分大的 x，不超过 x 的卡迈克尔数个数 C(x) 满足 C(x) > x^(2/7)<sup>[7](https://citeseerx.ist.psu.edu/document?doi=4b32f6405e241049bae2265187eaab82fe6c6042&repid=rep1&type=pdf)</sup><sup> • </sup><sup>[15](https://dms.umontreal.ca/~andrew/1994.php)</sup>。

## 分布与未定的界

2/7 这个指数已被改进。格林·哈曼（Glyn Harman）在 2005 年证明了存在 β > 0.33，使得对所有充分大的 x 都有 C(x) > x^β<sup>[7](https://citeseerx.ist.psu.edu/document?doi=4b32f6405e241049bae2265187eaab82fe6c6042&repid=rep1&type=pdf)</sup>。埃尔德什猜想了一个强得多的命题：对每个 ε > 0 和充分大的 x，都有 C(x) > x^(1−ε)；但目前还不知道有任何具体的 x 值能使 C(x) > x^(1/2)<sup>[7](https://citeseerx.ist.psu.edu/document?doi=4b32f6405e241049bae2265187eaab82fe6c6042&repid=rep1&type=pdf)</sup>。类似于素数定理那样关于 C(x) 的渐近公式，目前也未知<sup>[16](https://nzdr.ru/data/media/biblio/kolxoz/M/MT/Crandall%20R.%2C%20Pomerance%20C.%20Prime%20numbers.%20A%20computational%20perspective%20%282ed.%2C%20Springer%2C%202005%29%28604s%29.pdf)</sup>。

尽管卡迈克尔数无界增长，它们却十分稀少，远比素数稀少；一个大的随机整数极不可能是卡迈克尔数<sup>[9](https://ocw.mit.edu/courses/18-310-principles-of-discrete-applied-mathematics-fall-2013/9e96bf48fb5d12f1300365d05e227be1_MIT18_310F13_Ch15.pdf)</sup>。在对数尺度上，截至 10^21 的计数增长曲线位于 x^(1/3) 与 x^(2/7) 两条曲线之间<sup>[11](https://www.matpic.com/essays/the-numbers-that-fool-every-base/)</sup>。

## 计算与制表

海尔布伦数学研究所的理查德·平奇运用相关的搜索技术，先后计算了 10^15、10^16、10^17、10^18、10^20 和 10^21 以内的卡迈克尔数<sup>[17](https://zenodo.org/records/13755236)</sup><sup> • </sup><sup>[1](https://antsmath.org/ANTSVIII/files/pinch.pdf)</sup>。2024 年的一个项目生成了 10^22 以内的独立数表，并与平奇截至 10^21 的表以及克洛德·古蒂耶（Claude Goutier）一份未发表的表进行了核对，还报告了按素因子个数分类的精确计数：三个素因子的有 420,658 个，四个的有 232,742 个，五个的有 1,370,257 个，七个的有 14,056,367 个，等等<sup>[8](https://link.springer.com/article/10.1007/s40993-024-00598-3)</sup>。

## 素性检验

卡迈克尔数能击败朴素的费马检验，但有两种改进方法可以对付它们。索洛韦-施特拉森检验用雅可比符号来检查欧拉判别法，而米勒-拉宾检验则进一步沿着 a^(n−1) 反复开平方的链条向下走，寻找模 n 下 1 的非平凡平方根<sup>[2](https://crypto.stanford.edu/pbc/notes/numbertheory/carmichael.html)</sup>。在强检验的框架下，类似于科塞尔特判别法的定理不再成立：若 n 是奇合数，它在 1 到 n − 1 之间至多对 (n − 1)/4 个底数 a 通过米勒检验，因此不存在“强卡迈克尔数”<sup>[3](https://math.gordon.edu/ntic/ntic/section-strong-pseudoprime.html)</sup>。因此，对 k 个独立底数运行该检验，失败概率低于 (1/4)^k<sup>[3](https://math.gordon.edu/ntic/ntic/section-strong-pseudoprime.html)</sup>。

一个通过了费马检验阶段的卡迈克尔数，其实很容易分解：如果它在一个从 1 开始的序列上未通过米勒-拉宾检验，那么该检验就已经产生了模 n 下 1 的一个非平凡平方根，由此可以高效地算出一个因子<sup>[10](https://crypto.stanford.edu/pbc/notes/numbertheory/millerrabin.html)</sup>。

针对固定的见证底数列表，敌手性的构造仍然可行。弗朗索瓦·阿尔诺（François Arnault）描述了一种构造卡迈克尔数的方法，使它们成为对选定素数底数集合的强伪素数，并用它找到了会被 Axiom 和 Maple 等计算机代数软件包中的拉宾-米勒检验判为素数的合数；他还通过该方法的变体，为若干参数对构造了强卢卡斯伪素数<sup>[18](https://www.sciencedirect.com/science/article/pii/S0747717185710425)</sup>。另有工作表明，无论选取哪个有限的素数集合，都能找到无穷多个卡迈克尔数，它们对取自该集合的每个底数都是强伪素数<sup>[15](https://dms.umontreal.ca/~andrew/1994.php)</sup>。

## References

1. [R. G. E. Pinch, The Carmichael Numbers up to 10^21, ANTS VIII proceedings](https://antsmath.org/ANTSVIII/files/pinch.pdf)
2. [Number Theory notes, Primality Tests and Carmichael Numbers, crypto.stanford.edu](https://crypto.stanford.edu/pbc/notes/numbertheory/carmichael.html)
3. [Number Theory Interactive, Section on Strong Pseudoprimes and the Miller-Rabin test, Gordon College](https://math.gordon.edu/ntic/ntic/section-strong-pseudoprime.html)
4. [Notes on Primality Testing, University of Pennsylvania](https://www.cis.upenn.edu/~jean/RSA-primality-testing.pdf)
5. [NPTEL Module 8, Lecture 2: Fermat Primality Test](https://archive.nptel.ac.in/content/storage2/courses/106103015/module8/lec2/2.html)
6. [W. R. Alford, Andrew Granville, Carl Pomerance, There are infinitely many Carmichael numbers, Annals of Mathematics 139 (1994), 703–722](https://annals.math.princeton.edu/1994/193-3/p06)
7. [Andrzej Rotkiewicz, Annales Mathematicae Silesianae 21 (2007), 49–60](https://citeseerx.ist.psu.edu/document?doi=4b32f6405e241049bae2265187eaab82fe6c6042&repid=rep1&type=pdf)
8. [Advances in tabulating Carmichael numbers, Research in Number Theory (2024)](https://link.springer.com/article/10.1007/s40993-024-00598-3)
9. [MIT OpenCourseWare 18.310, Cryptography Notes, Chapter on primality](https://ocw.mit.edu/courses/18-310-principles-of-discrete-applied-mathematics-fall-2013/9e96bf48fb5d12f1300365d05e227be1_MIT18_310F13_Ch15.pdf)
10. [Number Theory notes, The Miller-Rabin Test, crypto.stanford.edu](https://crypto.stanford.edu/pbc/notes/numbertheory/millerrabin.html)
11. [The numbers that fool every base, Matpic](https://www.matpic.com/essays/the-numbers-that-fool-every-base/)
12. [Carmichael Number, CRC encyclopedia archive, Michigan State University](https://archive.lib.msu.edu/crcmath/math/math/c/c060.htm)
13. [R. D. Carmichael, On Composite Numbers P Which Satisfy the Fermat Congruence, The American Mathematical Monthly 19 (1912), 22–27, JSTOR](https://www.jstor.org/stable/2972687)
14. [Alford, Granville, Pomerance, There are infinitely many Carmichael numbers (PDF), Carl Pomerance's Dartmouth page](https://math.dartmouth.edu/~carlp/PDF/paper95.pdf)
15. [Andrew Granville, 1994 publications, Université de Montréal](https://dms.umontreal.ca/~andrew/1994.php)
16. [R. Crandall, C. Pomerance, Prime Numbers: A Computational Perspective, 2nd ed., Chapter 3](https://nzdr.ru/data/media/biblio/kolxoz/M/MT/Crandall%20R.%2C%20Pomerance%20C.%20Prime%20numbers.%20A%20computational%20perspective%20%282ed.%2C%20Springer%2C%202005%29%28604s%29.pdf)
17. [R. Pinch, The Carmichael numbers up to 10^21, Zenodo dataset (2024)](https://zenodo.org/records/13755236)
18. [F. Arnault, Constructing Carmichael Numbers which are Strong Pseudoprimes to Several Bases, Journal of Symbolic Computation 20 (1995), 151–161](https://www.sciencedirect.com/science/article/pii/S0747717185710425)
19. [Div Class Title a Conditional Density for Carmichael Numbers Div.pdf, cambridge.org](https://www.cambridge.org/core/services/aop-cambridge-core/content/view/E732DD46A7CF3D0EE22BB21D16D72645/S000497271900145Xa.pdf/div-class-title-a-conditional-density-for-carmichael-numbers-div.pdf)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Computational and probabilistic number theory › Primality testing algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/carmichael-number

English original: https://www.edgepedia.org/carmichael-number
