# 弗罗贝尼乌斯硬币问题

弗罗贝尼乌斯硬币问题问的是：给定一组互质的正整数，不能表示为它们的非负整数组合的最大整数是多少？也就是说，方程 \( a_1 x_1 + \cdots + a_n x_n = b \) 在要求所有 \( x_i \ge 0 \) 时无解，求 \( b \) 的最大值。这个最大值称为弗罗贝尼乌斯数 \( g(a_1, \ldots, a_n) \)，而求它的问题被称为硬币问题或换零钱问题。<sup>[1](https://mathworld.wolfram.com/FrobeniusNumber.html)</sup><sup> • </sup><sup>[2](https://mathworld.wolfram.com/CoinProblem.html)</sup> 该问题仅当系数互质时才是有限的：不可表示的正整数集合是有限集，当且仅当 \( \gcd(a_1, \ldots, a_n) = 1 \)。<sup>[3](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义 | 不能表示为 \( a_1 x_1 + \cdots + a_n x_n \)（其中 \( x_i \ge 0 \)）的最大整数；存在当且仅当 \( \gcd(a_1, \ldots, a_n) = 1 \)<sup>[3](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)</sup> |
| 双硬币公式 | 对互质的 \( a, b \)，\( g(a,b) = ab - a - b \)，不可表示的整数恰好有 \( \tfrac{1}{2}(a-1)(b-1) \) 个；由西尔维斯特解决<sup>[4](https://dummit.cos.northeastern.edu/teaching_sp21_4527/4527_lecture_03_farey_sequences_v2.pdf)</sup> |
| 发表 | 西尔维斯特，《第7382题》，Mathematical Questions from the Educational Times，第41卷，第21页（1884年）<sup>[1](https://mathworld.wolfram.com/FrobeniusNumber.html)</sup> |
| 复杂度 | 当 \( n \) 可变时，在图灵归约下是 NP 难的（拉米雷斯·阿尔方辛，Combinatorica，第16卷（1996年），第143—147页）<sup>[5](https://dblp.uni-trier.de/rec/journals/combinatorica/Ramirez-Alfonsin96.html)</sup> |
| 闭公式 | 三个生成元的精确公式是已知的，但不存在有限的、能计算所有三元组的弗罗贝尼乌斯数的多项式公式集<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup><sup> • </sup><sup>[11](https://web.iitd.ac.in/~atripath/publications/FP_3-var.pdf)</sup> |
| 计算示例 | \( g(4,9) = 23 \)；\( g(3,5) = 7 \)；不能表示为 6、9、20 的倍数之和的最大数是 43<sup>[1](https://mathworld.wolfram.com/FrobeniusNumber.html)</sup> |
| 伴随量 | 西尔维斯特数 \( n(A) \) 是不可表示整数的个数，满足 \( n(A) \ge \tfrac{1}{2}(1 + g(A)) \)<sup>[3](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)</sup> |

## 历史与命名

两变量的问题是在十九世纪提出并解决的。J. J. 西尔维斯特（J. J. Sylvester）于 1884 年在 Educational Times 上发表了结果：对互质的 \( a \) 和 \( b \)，恰好有 \( \tfrac{1}{2}(a-1)(b-1) \) 个整数不能写成 \( ax + by \)（其中 \( x, y \ge 0 \)）的形式，其中最大的是 \( ab - a - b \)。<sup>[4](https://dummit.cos.northeastern.edu/teaching_sp21_4527/4527_lecture_03_farey_sequences_v2.pdf)</sup><sup> • </sup><sup>[1](https://mathworld.wolfram.com/FrobeniusNumber.html)</sup> 这个问题的名字来自 F. G. 弗罗贝尼乌斯（F. G. Frobenius），他在讲座中反复提出这个问题，从而使西尔维斯特提出的问题流行开来。<sup>[3](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)</sup><sup> • </sup><sup>[7](https://staff.math.su.se/shapiro/ProblemSolving/NumericalSemigroups.pdf)</sup> 现代综合性的论述见豪尔赫·L·拉米雷斯·阿尔方辛（Jorge L. Ramírez Alfonsín）的专著《丢番图弗罗贝尼乌斯问题》（牛津大学出版社，2005 年），该书综述了数学若干领域中用于寻找弗罗贝尼乌斯数的公式和算法的方法。<sup>[8](https://academic.oup.com/book/9257)</sup>

## 双硬币情形

**西尔维斯特公式。** 当 \( \gcd(a, b) = 1 \) 时，弗罗贝尼乌斯数为 \( g(a,b) = ab - a - b \)，等价于 \( (a-1)(b-1) - 1 \)。<sup>[1](https://mathworld.wolfram.com/FrobeniusNumber.html)</sup> 一个直接的论证说明了为什么每个整数 \( n \ge (a-1)(b-1) \) 都是可表示的：用带余除法将 \( n \) 写成 \( n = qb + r \)，并利用乘以 \( a \) 会遍历模 \( b \) 的每个剩余类这一事实，便可将 \( n \) 改写为 \( ax + by \) 的形式，其中 \( x, y \) 为非负整数。因此，\( ab - a - b \) 是半群 \( \langle a, b \rangle \) 的补集中的最大元素。<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup> 例如，用 3 和 5 的硬币，可表示的金额为 \( \{0, 3, 5, 6, 8, 9, 10, 11, \ldots\} \)，公式给出 \( g = 5 \cdot 3 - 5 - 3 = 7 \)。<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup>

不可表示金额的个数在此情形下也是精确的：总数为 \( \tfrac{1}{2}(a_1 - 1)(a_2 - 1) \)。<sup>[2](https://mathworld.wolfram.com/CoinProblem.html)</sup> 这个计数是一个一般配对论证的实例。由于可表示值的集合 \( \Gamma(A) \) 对加法封闭，配对 \( n \)、\( g(A) - n \) 中至多有一个是可表示的；在 \( \{0, \ldots, g(A)\} \) 中将整数 \( n \) 与 \( g(A) - n \) 配对，可知西尔维斯特数 \( n(A) \)（即不可表示集合的基数）满足 \( n(A) \ge \tfrac{1}{2}(1 + g(A)) \)，且等号成立当且仅当每对中恰有一个成员不可表示。<sup>[3](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)</sup>

## 三个及更多生成元

**无一般闭公式。** 对于一个最小生成集含有 3 个或更多元素的数值半群，不存在有限的多项式集合，使得在生成元 \( n_1, \ldots, n_k \) 处求值就能返回弗罗贝尼乌斯数 \( g(S) \)，尽管对于三个生成元以及某些特殊族，精确的闭公式是已知的。<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup><sup> • </sup><sup>[11](https://web.iitd.ac.in/~atripath/publications/FP_3-var.pdf)</sup> 在一般情形 \( n \ge 3 \) 下，\( g(A) \) 不能由某种类型的闭公式给出，尽管许多特殊情形的公式已被确定。<sup>[9](https://www.sciencedirect.com/science/article/abs/pii/S0196885824000514)</sup>

特殊族确实有公式。对于三个变量，印度理工学院德里分校的数学教授阿米塔巴·特里帕蒂（Amitabha Tripathi）在《数论杂志》（2017 年）上发表了覆盖所有互质 \( a, b, c \) 情形的精确公式。<sup>[10](https://www.sciencedirect.com/science/article/pii/S0022314X16301743)</sup> 一个由爱因斯坦、利希特布劳、斯特热本斯基和瓦贡得到的推论给出了 \( g(a, a+1, a+4) \) 作为 \( a \) 的分段二次函数，具体取决于 \( a \bmod 4 \)；例如，当 \( a \equiv 0 \pmod 4 \) 时，\( g(a, a+1, a+4) = \tfrac{1}{4}(a^2 + 8a - 4) \)。<sup>[11](https://web.iitd.ac.in/~atripath/publications/FP_3-var.pdf)</sup> 对于等差数列，塞尔默（Selmer）的一个结果表明，只要 \( h \) 是正整数且 \( \gcd(a,d) = 1 \)，就有 \( g(a, ha+d, \ldots, ha+kd) = ha\lfloor (a-2)/k \rfloor + (h-1)a + d(a-1) \)。<sup>[11](https://web.iitd.ac.in/~atripath/publications/FP_3-var.pdf)</sup>

## 复杂度与算法

当生成元个数可变时，该问题在计算上是困难的。拉米雷斯·阿尔方辛（Ramírez Alfonsín）于 1996 年通过将背包问题在多项式时间内归约到该问题，证明了弗罗贝尼乌斯问题在图灵归约下是 NP 难的。<sup>[5](https://dblp.uni-trier.de/rec/journals/combinatorica/Ramirez-Alfonsin96.html)</sup><sup> • </sup><sup>[12](https://www.ime.usp.br/~oalg/files/Drensky_LieJor_Dec_17_2020.pdf)</sup> 然而，对于每个固定的 \( n \)，拉维·坎南（Ravi Kannan）利用格的覆盖半径概念给出了一个多项式时间算法；其复杂度形如 \( O(\log(a)^{n^n}) \)，这使其不切实际。<sup>[9](https://www.sciencedirect.com/science/article/abs/pii/S0196885824000514)</sup> 对于较小的 \( n \)，存在实用的算法：格林伯格（Greenberg）给出了 \( n = 3 \) 时运行时间为 \( O(\log a) \) 的快速算法，而爱因斯坦、利希特布劳、斯特热本斯基和瓦贡给出了一个快速但非多项式的算法，可计算至多 \( n = 11 \) 时的 \( g(A) \)。<sup>[9](https://www.sciencedirect.com/science/article/abs/pii/S0196885824000514)</sup>

一个标准的计算工具是阿佩里集：对于最小生成元（重数）为 \( n_1 \) 的数值半群 \( S \)，阿佩里集记录了 \( S \) 中每个模 \( n_1 \) 剩余类中的最小元素，从阿佩里集的最大值中减去重数便得到弗罗贝尼乌斯数。<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup> 一种更简单的列举方法利用了这样一个事实：一旦有 \( n_1 \) 个连续整数属于 \( S \)，之后每个整数也都属于 \( S \)，因为加上 \( n_1 \) 会将它们各自向前平移。<sup>[6](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)</sup>

## 数值半群与应用

该问题的现代背景是数值半群 \( S = \langle n_1, \ldots, n_e \rangle \)，即非负整数的一个子集，它包含 0、对加法封闭，且补集有限。补集中的元素称为间隙，最大的间隙就是弗罗贝尼乌斯数，间隙的个数称为亏格 \( g(S) \)。<sup>[13](https://www.umu.se/en/research/projects/numerical-semigroups/)</sup> 一组生成元生成数值半群，当且仅当它们的最大公约数为 1，这正是使弗罗贝尼乌斯数存在的同一条件。<sup>[14](https://numerical-semigroups.github.io/wiki/)</sup>

该问题远远超出了硬币算术的范围。弗罗贝尼乌斯数出现在组合数学、分拆理论、交换代数、代数几何、概率论和计算机科学中。<sup>[15](https://codingtheory.cs.technion.ac.il/wp-content/uploads/sites/43/2017/12/4-Leonid-Fel-Dec.-10th-2017-Frobenius-Problem-in-Numerical-Semigroups-title.pdf)</sup> 在代数几何中，对于域 \( K \)，环 \( A = K[t^{a_1}, \ldots, t^{a_n}] \) 是由 \( t^{a_1}, \ldots, t^{a_n} \) 参数化的曲线的坐标环，关于曲线的信息可以从指数生成的数值半群中导出。<sup>[7](https://staff.math.su.se/shapiro/ProblemSolving/NumericalSemigroups.pdf)</sup> 同一方程也是运筹学中整数背包问题的基础，后者同样也是 NP 难的；弗罗贝尼乌斯问题可以表述为：求最小的 \( g \)，使得对每个 \( b > g \)，背包多面体 \( P(a,b) \) 都包含一个整数点。<sup>[16](https://www1.claremontmckenna.edu/pages/faculty/lenny/papers/GNT_lecture_notes.pdf)</sup> 一个密切相关的变体——弗罗贝尼乌斯邮票问题——研究的是 \( \mathbb{Z}^n \) 的有限生成集在 \( N \) 充分大时的 \( N \) 重和集。<sup>[17](https://arxiv.org/abs/2003.04076)</sup>

## References

1. [Weisstein, Eric W. "Frobenius Number." MathWorld--A Wolfram Resource](https://mathworld.wolfram.com/FrobeniusNumber.html)
2. [Weisstein, Eric W. "Coin Problem." MathWorld--A Wolfram Resource](https://mathworld.wolfram.com/CoinProblem.html)
3. [Tripathi, Amitabha (2018). "A note on the Frobenius and the Sylvester numbers." Notes on Number Theory and Discrete Mathematics 24(2), 71-73](https://web.iitd.ac.in/~atripath/publications/FrobSylv_note.pdf)
4. ["More Frobenius Coin Problem, I," lecture notes, Northeastern University](https://dummit.cos.northeastern.edu/teaching_sp21_4527/4527_lecture_03_farey_sequences_v2.pdf)
5. [Ramírez Alfonsín, Jorge L. (1996). "Complexity of the Frobenius Problem." Combinatorica 16(1), 143-147](https://dblp.uni-trier.de/rec/journals/combinatorica/Ramirez-Alfonsin96.html)
6. [Benjamin, Anders, Eyer. "Computation of Frobenius Numbers and the Apéry Set," University of California, Irvine](https://bpb-us-e2.wpmucdn.com/sites.uci.edu/dist/1/5834/files/2026/05/Computation_of__Frobenius_Numbers_via_the_Apery_set-Benjamin-Anders-Eyer.pdf)
7. [Assi, Abdallah; García-Sánchez, Pedro A. "Numerical Semigroups and Applications"](https://staff.math.su.se/shapiro/ProblemSolving/NumericalSemigroups.pdf)
8. [Ramírez Alfonsín, Jorge L. (2005). *The Diophantine Frobenius Problem*. Oxford University Press](https://academic.oup.com/book/9257)
9. ["A combinatorial approach to Frobenius numbers of some special sequences," Journal of Number Theory (ScienceDirect)](https://www.sciencedirect.com/science/article/abs/pii/S0196885824000514)
10. [Tripathi, Amitabha (2017). "Formulae for the Frobenius number in three variables." Journal of Number Theory 170, 368-389](https://www.sciencedirect.com/science/article/pii/S0022314X16301743)
11. [Tripathi, Amitabha (2017). "Formulae for the Frobenius number in three variables" (full text PDF)](https://web.iitd.ac.in/~atripath/publications/FP_3-var.pdf)
12. [Drensky, Vesselin. "From a Diophantine transport problem from 2016 and its possible solution from 1903 to classical problems in algebra" (IME-USP)](https://www.ime.usp.br/~oalg/files/Drensky_LieJor_Dec_17_2020.pdf)
13. ["Numerical Semigroups," research project overview, Umeå University](https://www.umu.se/en/research/projects/numerical-semigroups/)
14. ["About Numerical Semigroups," Wiki numerical semigroups](https://numerical-semigroups.github.io/wiki/)
15. [Fel, Leonid G. (2017). "Frobenius Problem in Numerical Semigroups," Technion expository talk](https://codingtheory.cs.technion.ac.il/wp-content/uploads/sites/43/2017/12/4-Leonid-Fel-Dec.-10th-2017-Frobenius-Problem-in-Numerical-Semigroups-title.pdf)
16. ["Geometric Number Theory," lecture notes, Claremont McKenna College](https://www1.claremontmckenna.edu/pages/faculty/lenny/papers/GNT_lecture_notes.pdf)
17. [Granville, Andrew; Shakan, George (2020). "The Frobenius postage stamp problem, and beyond." arXiv:2003.04076](https://arxiv.org/abs/2003.04076)

---
*Initially written Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 数与代数 › Number theory › Diophantine problems and approximation › Linear and additive Diophantine equations

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/frobenius-coin-problem

English original: https://www.edgepedia.org/frobenius-coin-problem
