# 费马数

费马数（Fermat number）是形如 \( F_n = 2^{2^n} + 1 \) 的整数，以皮埃尔·德·费马（Pierre de Fermat）命名，他在17世纪研究了这类数。当 \( n = 0, 1, 2, \ldots \) 时，前几个值为 3、5、17、257、65537、4294967297，依此类推<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。这个数列之所以著名，是因为费马曾误以为它的每一项都是素数，因为已知仅有五个费马素数，也因为它与正多边形可构造性的联系。<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | \( F_n = 2^{2^n} + 1 \)；前几个值 3、5、17、257、65537、4294967297<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 已知费马素数 | 仅有 \( F_0 \) 到 \( F_4 \)：3、5、17、257、65537；\( F_4 \) 之后没有任何 \( F_n \) 已知为素数<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup><sup> • </sup><sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup> |
| 首个合数 | \( F_5 = 4294967297 = 641 \times 6700417 \)，由欧拉指出<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 两两互素 | 任意两个费马数都没有大于1的公因子；\( F_m = F_0 F_1 \cdots F_{m-1} + 2 \)<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 素性检验 | 佩潘检验：\( F_n \) 是素数当且仅当 \( 3^{(F_n - 1)/2} \equiv -1 \pmod{F_n} \)<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 因子形式 | 当 \( n > 1 \) 时，\( F_n \) 的任意因子都具有 \( 2^{n+2}L + 1 \) 的形式（卢卡斯，1878年）<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 分解状况 | 截至2022年，\( F_5 \) 到 \( F_{11} \) 已完全分解，且对于所有 \( 5 \le n \le 33 \)，\( F_n \) 已知为合数<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup> |
| 几何 | 正 \( n \) 边形可用直尺和圆规构造，当且仅当 \( n \) 是2的幂乘以若干个互不相同的费马素数之积<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup> |

## 定义与基本性质

定义中的双重指数使这个数列增长得极快。\( F_n \) 的十进制位数约为 \( 1 + 2^n \log 2 \)，因此当 \( n = 0, 1, 2, \ldots \) 时，位数依次为 1、1、2、3、5、10、20、39、78、155、309、617、1234，依此类推<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

两个结构性事实使这个数列有了用处。第一，费马数满足递推关系 \( F_m = F_0 F_1 \cdots F_{m-1} + 2 \)，由此可知任意两个费马数都没有大于1的公因子<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。这种两两互素性在Lean数学库Mathlib中也有形式化<sup>[3](https://math.iisc.ac.in/~gadgil/PfsProgs25doc/Mathlib/NumberTheory/Fermat.html)</sup>。由于每个费马数必定被某个不整除任何更早费马数的素数整除，这个数列直接给出了素数有无穷多个的证明<sup>[4](https://citeseerx.ist.psu.edu/document?doi=d6ffbac964d58c4629f76e0d9cb8c39bcc989964&repid=rep1&type=pdf)</sup>。

第二，具有费马形式是 \( 2^n + 1 \) 为素数的必要条件：若 \( n \) 含有奇因子 \( b \)，则 \( 2^n + 1 \) 可代数分解，因此这种形状的素数要求 \( n \) 是2的幂<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

## 费马的猜想与欧拉的反驳

费马观察到 \( F_0, F_1, F_2, F_3, \) 和 \( F_4 \)，即 3、5、17、257 和 65537，全都是素数，并曾写道他有一个证明能说明每个 \( F_n \) 都是素数<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>。大约一个世纪后，欧拉指出 \( F_5 \) 不是素数，其分解为 \( F_5 = 4294967297 = 641 \times 6700417 \)<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup><sup> • </sup><sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>。\( F_4 \) 之后没有任何 \( F_n \) 已知为素数，已知的费马素数也只有这五个<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup><sup> • </sup><sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>。

这个猜想是逐步被推翻的。截至目前的记录，所有 \( 5 \le n \le 33 \) 的 \( F_n \) 都已知为合数<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。有些结论来得较晚：到20世纪80年代初，除 \( n = 20, 22, 24, 28, \) 和 31 外，所有 \( 5 \le n \le 32 \) 的合数性都已确立；杨和比尔于1988年证明 \( F_{20} \) 为合数，克兰德尔及其同事于1995年解决 \( F_{22} \)，2003年解决 \( F_{24} \)，陶拉于1997年找到 \( F_{28} \) 的一个小因子，克鲁帕找到了 \( F_{31} \) 的第一个已知因子<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup><sup> • </sup><sup>[5](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)</sup>。一个更大胆的猜想——迭代序列 \( 2^2+1, \) \( 2^{2^2}+1, \) \( 2^{2^{2^2}}+1, \ldots \) 完全由素数组成——在1953年被塞尔弗里奇推翻，他证明 \( F_{16} \) 是合数<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

## 素性检验：佩潘检验

由于 \( F_n - 1 \) 是纯粹的2的幂，费马数拥有专门的素性检验。佩潘定理指出，\( F_n \) 是素数当且仅当

\[ 3^{(F_n - 1)/2} \equiv -1 \pmod{F_n}. \]

这个条件既是必要的也是充分的，因此一次模幂运算就能解决问题<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。该检验依赖于这样一个事实：当 \( F_n \) 为素数时，含 \( F_n \) 个元素的域的乘法群是阶为 \( 2^{2^n} \)（即2的纯幂）的循环群，并由3生成<sup>[6](https://www.math.utah.edu/~savin/fermat_jnt.pdf)</sup>。佩潘于1877年给出了他的判别法，最初用底数5代替3<sup>[7](https://thales.doa.fmph.uniba.sk/macaj/skola/teoriapoli/primes.pdf)</sup>。

其代价主要由模幂运算决定，而模幂运算又取决于巨大整数的乘法。指标 \( n \) 每增加1，佩潘检验所需的机器计算量大约变为原来的四倍<sup>[5](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)</sup>。对 \( F_{24} \)（有5,050,446个十进制位）进行的两次独立佩潘检验是在单台商用处理器上运行的，这与十年前 \( F_{20} \) 和 \( F_{22} \) 所需的向量超级计算机相比是显著变化<sup>[5](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)</sup>。除佩潘检验外，当时在俄亥俄州立大学和犹他大学任职的数学家罗伯特·德诺姆和戈登·萨文利用带复乘的椭圆曲线，为费马数开发了素性检验<sup>[6](https://www.math.utah.edu/~savin/fermat_jnt.pdf)</sup>。

## 因式分解

费马数因其规模而难以分解。截至2022年，只有 \( F_5 \) 到 \( F_{11} \) 已被完全分解<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>：

- \( F_5 = 641 \cdot 6700417 \)（欧拉，1732年）
- \( F_6 = 274177 \cdot 67280421310721 \)（兰德里，1880年）
- \( F_7 \) 由莫里森和布里尔哈特于1975年分解
- \( F_8 \) 由布伦特和波拉德于1981年分解
- \( F_9 \) 由马纳斯和伦斯特拉于1993年分解，这是一个155位数，含三个素因子
- \( F_{10} \)，309位，四个因子（布伦特，1995年）
- \( F_{11} \)，617位，五个因子（布伦特，1988年）<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>

1990年对第九个费马数 \( F_9 \) 的分解需要数百台计算机<sup>[8](https://algo.inria.fr/seminars/sem00-01/morain.html)</sup>。除完全分解外，\( F_{12} \) 有6个已知因子，剩余一个1133位的合数；\( F_{13} \) 有4个已知因子，剩余一个2391位的合数；\( F_{14} \) 有一个已知因子，剩余一个4880位的合数<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。有两个费马数 \( F_{20} \) 和 \( F_{24} \) 已知为合数，但两者的任何单个因子都未知<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

搜索工作受到因子形状的严格限制的指导。欧拉于1770年指出，\( F_n \) 的任意因子必须具有 \( 2^{n+1}K + 1 \) 的形式，卢卡斯于1878年将其加强为：当 \( n > 1 \) 时，形式为 \( 2^{n+2}L + 1 \)<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。因此，费马数的因子都是普罗思素数，即形如 \( k \cdot 2^n + 1 \) 的素数，只要附加条件 \( k \) 为奇数且 \( 2^n > k \) 成立<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

费马本人的名字也附着于一种针对奇整数的确定性分解方法，它与试除法一起被列为保证在有界时间内找到分解的算法，尽管速度较慢<sup>[9](https://dlmf.nist.gov/27.19)</sup>。

## 可构造多边形

费马素数支配着一个经典的几何问题。1796年，年仅18岁的高斯（Gauss）证明了正17边形可用直尺和圆规构造，这是自希腊古代以来多边形可构造性问题的首次进展<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>。随后他证明，只要 \( p \) 是费马素数，正 \( p \) 边形就可构造，而高斯-旺策尔定理完成了这一刻画：正 \( n \) 边形可构造当且仅当 \( n = 2^a p_1 p_2 \cdots p_k \)，其中 \( p_i \) 是互不相同的费马素数<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup>。高斯在其1801年的《算术研究》（*Disquisitiones Arithmeticae*）中声称了逆命题；第一个发表的必要性证明由皮埃尔·洛朗·旺策尔（Pierre Laurent Wantzel）于1837年给出，不过也有人将第一个完全严格的证明归于皮尔庞特（1895年）<sup>[2](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)</sup><sup> • </sup><sup>[10](https://math.maclabs.studio/en/problems/constructible-polygons)</sup>。

该定理解释了为什么五个已知费马素数在几何上重要。边数为3、5、17、257和65537的正多边形可构造，边数为这些互不相同素数之积、再任意翻倍的正多边形也可构造<sup>[11](https://www.nationalacademies.org/read/11543/chapter/29)</sup>。显式构造紧随理论之后：埃尔欣格在1800年前后给出了十七边形的第一个构造，里舍洛和施文登魏因于1832年构造了257边形，约翰·古斯塔夫·赫尔墨斯在1900年前后于哥廷根花了十年时间完成65537边形的手稿<sup>[12](https://mathworld.wolfram.com/GeometricConstruction.html)</sup>。由于65537之后没有已知的费马素数，已知最大的奇数边可构造多边形是正4,294,967,295边形，其边数是五个已知费马素数之积；已知的可构造奇数边多边形共有31个，对应五个已知费马素数的非空乘积<sup>[13](https://oeis.org/wiki/Constructible_polygons)</sup><sup> • </sup><sup>[17](https://oeis.org/wiki/Constructible_odd-sided_polygons)</sup>。

## 快速乘法中的费马数

代数形式 \( 2^{2^n} + 1 \) 在计算算术中再次出现。舍恩哈格-斯特拉森算法（Schönhage–Strassen algorithm，1971年）是实际用于将有数十万位或数十亿位的数相乘的方法，它在形如 \( 2^m + 1 \) 的数上做模运算，其中 \( 2^{2m/K} \) 充当本原K次单位根，因此费马式的环在快速傅里叶变换中取代了复数<sup>[14](https://institucional.us.es/blogimus/en/2018/03/multiplication-is-easier-than-you-might-think/)</sup>。GMP库将其大整数乘法描述为遵循舍恩哈格和斯特拉森的费马式快速傅里叶变换乘法<sup>[15](https://gmplib.org/manual/FFT-Multiplication)</sup>。阿诺德·舍恩哈格后来将这种费马数方法推广到对适当 \( N \) 值的 \( 2^N + 1 \) 模快速乘法<sup>[16](https://pages.iai.uni-bonn.de/schoenhage_arnold/topics.html)</sup>。这种联系是双向的：对巨大费马数的佩潘检验依赖于基于变换的大整数乘法，而同样的模算术也是最快的通用乘法程序的基础<sup>[5](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)</sup><sup> • </sup><sup>[14](https://institucional.us.es/blogimus/en/2018/03/multiplication-is-easier-than-you-might-think/)</sup>。

## 未解状况

是否存在无穷多个费马素数尚不清楚；艾森斯坦于1844年将其作为问题提出<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。同样不清楚的是，是否存在 \( n > 4 \) 的 \( F_n \) 为素数。随着计算的推进，状态未定的最小费马数不断上移：在 \( F_{24} \) 工作时期，它是8吉比特的 \( F_{33} \)，据估计一次佩潘检验大约需要 \( 2.5 \times 10^{9} \) 个十进制位的工作空间，即2,585,827,973位<sup>[5](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)</sup>。原则上，给定费马数的素性总可以通过佩潘检验确定，因此未解问题涉及的是因子和无穷性，而非可判定性<sup>[1](https://mathworld.wolfram.com/FermatNumber.html)</sup>。

## References

1. [Fermat Number, Wolfram MathWorld](https://mathworld.wolfram.com/FermatNumber.html)
2. [Constructible Regular Polygons and the Gauss–Wantzel Theorem, University of Kentucky lecture notes](https://www.ms.uky.edu/~sohum/ma330/files/eqns_3.pdf)
3. [Mathlib.NumberTheory.Fermat, Mathlib documentation](https://math.iisc.ac.in/~gadgil/PfsProgs25doc/Mathlib/NumberTheory/Fermat.html)
4. [Number Theory: A Contemporary Introduction (pairwise coprimality of Fermat numbers), CiteSeerX](https://citeseerx.ist.psu.edu/document?doi=d6ffbac964d58c4629f76e0d9cb8c39bcc989964&repid=rep1&type=pdf)
5. [Crandall, R. et al., "The Twenty-Fourth Fermat Number Is Composite," Mathematics of Computation 72 (2003)](https://www.reed.edu/physics/faculty/crandall/papers/F24.pdf)
6. [Denomme, R. and Savin, G., "Elliptic curve primality tests for Fermat and related primes," Journal of Number Theory 128 (2008)](https://www.math.utah.edu/~savin/fermat_jnt.pdf)
7. [Prime Numbers lecture notes, Comenius University Bratislava](https://thales.doa.fmph.uniba.sk/macaj/skola/teoriapoli/primes.pdf)
8. [Morain, F., "Thirty Years of Integer Factorization," INRIA seminar](https://algo.inria.fr/seminars/sem00-01/morain.html)
9. [DLMF §27.19 Methods of Computation: Factorization, NIST](https://dlmf.nist.gov/27.19)
10. [Constructible regular polygons (Gauss–Wantzel), Math Labs](https://math.maclabs.studio/en/problems/constructible-polygons)
11. [The Secret Life of Numbers, chapter on constructible polygons, National Academies Press](https://www.nationalacademies.org/read/11543/chapter/29)
12. [Geometric Construction, Wolfram MathWorld](https://mathworld.wolfram.com/GeometricConstruction.html)
13. [Constructible polygons, OeisWiki](https://oeis.org/wiki/Constructible_polygons)
14. [Arias de Reyna, J., "Multiplication is easier than you might think," Instituto de Matemáticas, Universidad de Sevilla (2018)](https://institucional.us.es/blogimus/en/2018/03/multiplication-is-easier-than-you-might-think/)
15. [FFT Multiplication, GNU MP 6.3.0 manual](https://gmplib.org/manual/FFT-Multiplication)
16. [Topics, Arnold Schönhage publication page](https://pages.iai.uni-bonn.de/schoenhage_arnold/topics.html)
17. [Constructible Odd Sided Polygons, oeis.org](https://oeis.org/wiki/Constructible_odd-sided_polygons)

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

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Arithmetic and number systems › Integer sequences and partitions › Special and named integers › Mersenne, Fermat, and form-defined exponential numbers

Copyright 2026 Edgepedia

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

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

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