# 斐波那契取子游戏

**斐波那契取子游戏**（Fibonacci Nim）是一种双人取子游戏：两人轮流从单独一堆石子中取子，每一方至多可取走上一方所取数目的两倍，先手不得一次取光整堆，取走最后一颗石子者获胜。它是一个无偏组合博弈，其必败的初始堆大小恰为斐波那契数，而其制胜策略则通过整数的齐肯多夫表示来表达。

| 关键事实 | 说明 |
|---|---|
| 规则 | 先手从 N 颗石子中取走 1 至 N−1 颗；此后，面对上一次取走 x 颗的一方最多可取 2x 颗；取走最后一颗者胜<sup>[1](https://ics.uci.edu/~eppstein/cgt/fibnim.html)</sup> |
| 必败的起始局面 | 当且仅当初始堆大小 N 为斐波那契数（2、3、5、8……）时，后手必胜<sup>[1](https://ics.uci.edu/~eppstein/cgt/fibnim.html)</sup> |
| 起源 | 由俄勒冈州立大学的罗伯特·E·加斯凯尔（Robert E. Gaskell）发明；马丁·加德纳（Martin Gardner）在《数学马戏团》（Mathematical Circus）中加以讨论<sup>[2](https://archive.computerhistory.org/resources/access/text/2017/09/102661095/102661095-05-v10-n2-acc.pdf)</sup> |
| 制胜着法 | 取走剩余石堆的齐肯多夫表示中最小的那个斐波那契数<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup> |
| 首次分析 | P局面（格兰迪值为 0）自 1963 年惠尼汉（Whinihan）以来即已为人所知<sup>[4](https://arxiv.org/abs/1410.0332)</sup> |
| 多堆变体 | 全局斐波那契取子游戏，所有堆共用一个取子上限，由拉松（Larsson）与鲁宾斯坦-萨尔泽多（Rubinstein-Salzedo）于 2015 年解决了两堆情形<sup>[5](https://arxiv.org/abs/1509.08527)</sup> |

## 规则

两方之间放置一堆 N 颗石子，N > 1。玩家 1 先行，可取走任意多颗石子，只须至少留下一颗。此后，若一方取走 x 颗石子，下一方最多可取 2x 颗，且至少取一颗。取走最后一颗石子者获胜<sup>[1](https://ics.uci.edu/~eppstein/cgt/fibnim.html)</sup>。例如，一堆 10 颗时，先手若取走 3 颗，则留给对手的最大取子量为 6 颗<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup>。

这一上限使博弈依赖于历史。两个各含六颗石子的局面，若上限不同（比如上限为二与上限为五），便成为不同的博弈；也就是说，博弈状态不仅包括石子堆的大小，还包括上一手<sup>[6](https://www.combinatorial-game-theory.com/essays/the-heap-is-not-the-position/)</sup>。一个局面记作数对 (ℓ, r)，其中 ℓ 是限额，即可取走的最大石子数，r 是余量，即剩下的石子数；初始石堆为 n 的局面就是 (n−1, n)<sup>[7](https://math.stackexchange.com/questions/2762700/proof-of-winning-strategy-in-fibonacci-nim)</sup>。

## 必败局面与制胜策略

当且仅当初始堆大小为斐波那契数，即 2、3、5、8、13……之一时，后手有必胜的把握<sup>[1](https://ics.uci.edu/~eppstein/cgt/fibnim.html)</sup>。按卡内基梅隆大学（CMU）讲义中的记号，对一切 k ≥ 1，(F<sub>k</sub>, ∗) 都是 P局面；而只要 n 不在[斐波那契数列](https://www.edgepedia.org/zh/fibonacci-sequence)之中，(n, ∗) 就是 N局面<sup>[8](https://www.math.cmu.edu/~af1p/Teaching/Combinatorics/F03/Class31.pdf)</sup>。

这套策略以[齐肯多夫定理](https://www.edgepedia.org/zh/zeckendorfs-theorem)为基石：每个正整数都可唯一地写成若干互不相邻的斐波那契数之和<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup>。例如 32 = 21 + 8 + 3 = F<sub>8</sub> + F<sub>6</sub> + F<sub>4</sub> 是一个合法的齐肯多夫表示，而 21 + 5 + 3 + 2 + 1 则不是，因为它用到了相邻的斐波那契数<sup>[7](https://math.stackexchange.com/questions/2762700/proof-of-winning-strategy-in-fibonacci-nim)</sup>。所依据的不等式是：对 n ≥ 2，F<sub>n+2</sub> > 2F<sub>n</sub>，因此表示中所用的每个斐波那契数都大于比它小的那一项的两倍<sup>[7](https://math.stackexchange.com/questions/2762700/proof-of-winning-strategy-in-fibonacci-nim)</sup>。

制胜着法是取走齐肯多夫表示中最小的那一项，即剩余石堆的长度为 1 的尾项 T(n)<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup>。等价地说，局面 (ℓ, r) 对轮到走的一方是胜局，当且仅当 r 的齐肯多夫表示中最小的斐波那契数不超过 ℓ<sup>[7](https://math.stackexchange.com/questions/2762700/proof-of-winning-strategy-in-fibonacci-nim)</sup>。由于表示中不含相邻项，取走最小项之后，对手的上限至多是它的两倍，而再上一项大于最小项的两倍，所以对手无法一次把表示中其余的石子全部取走<sup>[6](https://www.combinatorial-game-theory.com/essays/the-heap-is-not-the-position/)</sup>。

艾伦（Allen）与波诺马连科（Ponomarenko）在 2014 年发表于《Involve》的论文中，完整刻画了所有类型的制胜着法：他们把已知的、取走长度为 1 的尾项的制胜算法，作为一条一般性制胜算法的推论加以证明，并证明不存在别的制胜算法<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup>。同一篇论文还表明，随着石子数的增加，一名生手战胜好手的概率以指数速度趋于零<sup>[3](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)</sup>。

## 格兰迪值

在斯普拉格-格兰迪（Sprague-Grundy）框架下，每个无偏博弈局面都等价于一个单独的尼姆堆，这种等价由 mex 规则算出，即各选项的取值中未出现的最小非负整数<sup>[9](https://www.combinatorial-game-theory.com/essays/sprague-grundy/)</sup>。就斐波那契取子游戏而言，决定制胜策略的格兰迪值为 0 的局面，自惠尼汉 1963 年在《斐波那契季刊》上的分析以来即已为人所知<sup>[4](https://arxiv.org/abs/1410.0332)</sup><sup> • </sup><sup>[10](https://www.fq.math.ca/Scanned/1-4/whinihan.pdf)</sup>。乌尔班·拉松（Urban Larsson）与西蒙·鲁宾斯坦-萨尔泽多（Simon Rubinstein-Salzedo）推进了这一分析，算出了格兰迪值至多为 3 的全部局面，并证明：若删去格兰迪值为 0 的斐波那契数，则起始局面的格兰迪值单调递增，且其增长率有上下界<sup>[4](https://arxiv.org/abs/1410.0332)</sup>。

## 变体与因子族

**全局斐波那契取子游戏**（Global Fibonacci Nim）是一种多堆变体：玩家选定一堆，按斐波那契取子游戏的规则走子，但取子数量的限制是一个对任何堆都适用的全局参数。拉松与鲁宾斯坦-萨尔泽多研究了它的性质，并解决了两堆的情形<sup>[5](https://arxiv.org/abs/1509.08527)</sup>。斐波那契取子游戏各堆的求和并不在通常理论的覆盖范围之内：共用一个上限的两堆构成一个定义明确的博弈，其分析不见于文献；而每堆各有上限的两堆则构成另一个定义明确的博弈<sup>[6](https://www.combinatorial-game-theory.com/essays/the-heap-is-not-the-position/)</sup>。

加倍规则中的因子 2 是一个自由参数。若规则允许最多取上一手的 c 倍，则每个 c 都给出一种不同的博弈。c = 1 时，必败的石堆大小是 2 的幂；c = 3、4、5 时，则得到另外四个序列（在已经提到的两个之外），每个序列都有一个线性递推式，其滞后为因子减一后的两倍。这一模式到 c = 6 即告终止<sup>[11](https://www.combinatorial-game-theory.com/ladders/fibonacci-nim/)</sup>。该族中的每个因子还给出一种记数系统：二进制是 c = 1 的答案，齐肯多夫表示是 c = 2 的答案，二者由同一机制产生——制胜着法取走最小项，而再上一项超过它的 c 倍<sup>[6](https://www.combinatorial-game-theory.com/essays/the-heap-is-not-the-position/)</sup>。在这道阶梯上，不超过 120 的斐波那契数中恰有九个是先手的败局；而在该范围内其余 110 堆中的每一堆，取走齐肯多夫表示中最小的加项即可确保胜利<sup>[11](https://www.combinatorial-game-theory.com/ladders/fibonacci-nim/)</sup>。

有一条一般性定理涵盖了所有这类单堆动态博弈：设单调不减的函数 f 以 f(n) 作为下一手的上限，则必败的初始堆大小 H<sub>1</sub> < H<sub>2</sub> < ... 满足 H<sub>j+1</sub> = H<sub>j</sub> + H<sub>ℓ</sub>，其中 H<sub>ℓ</sub> 是满足 f(H<sub>i</sub>) ≥ H<sub>j</sub> 的最小的在先必败大小 H<sub>i</sub>；若 f(H<sub>j</sub>) < H<sub>j</sub>，则必败局面的序列是有限的，并以 H<sub>j</sub> 告终<sup>[8](https://www.math.cmu.edu/~af1p/Teaching/Combinatorics/F03/Class31.pdf)</sup>。f(n) = n 与 f(n) = 2n 两种情形分别给出 2 的幂与斐波那契数<sup>[8](https://www.math.cmu.edu/~af1p/Teaching/Combinatorics/F03/Class31.pdf)</sup>。

## 历史

斐波那契取子游戏由俄勒冈州立大学的罗伯特·E·加斯凯尔发明，经由[马丁·加德纳](https://www.edgepedia.org/zh/martin-gardner)《数学马戏团》中“斐波那契数与卢卡斯数”一章而为广大读者所知<sup>[2](https://archive.computerhistory.org/resources/access/text/2017/09/102661095/102661095-05-v10-n2-acc.pdf)</sup>。惠尼汉 1963 年发表于《斐波那契季刊》的论文首次给出了 P局面的完整分析<sup>[10](https://www.fq.math.ca/Scanned/1-4/whinihan.pdf)</sup>。该游戏属于组合博弈论所研究的减法游戏与取子游戏一族；组合博弈论研究的是无随机性、无隐藏信息的双人博弈<sup>[9](https://www.combinatorial-game-theory.com/essays/sprague-grundy/)</sup>。

## References

1. [Fibonacci Nim rules and losing positions, David Eppstein, Generalized Fibonacci Nim, UC Irvine](https://ics.uci.edu/~eppstein/cgt/fibnim.html)
2. [Mary Ann Gohlke, "Welcome to the Game of FIBONACCI NIM!", Games and Programs, Recreational Computing Vol. 10 No. 2, Computer History Museum archive](https://archive.computerhistory.org/resources/access/text/2017/09/102661095/102661095-05-v10-n2-acc.pdf)
3. [Cody Allen and Vadim Ponomarenko (2014). Fibonacci Nim and a full characterization of winning moves. Involve 7:6, 807–826.](https://msp.org/involve/2014/7-6/involve-v7-n6-p08-p.pdf)
4. [Urban Larsson and Simon Rubinstein-Salzedo (2014). Grundy values of Fibonacci nim. arXiv:1410.0332.](https://arxiv.org/abs/1410.0332)
5. [Urban Larsson and Simon Rubinstein-Salzedo (2015). Global Fibonacci Nim. arXiv:1509.08527.](https://arxiv.org/abs/1509.08527)
6. [The heap is not the position, Combinatorial Game Theory](https://www.combinatorial-game-theory.com/essays/the-heap-is-not-the-position/)
7. [Proof of winning strategy in Fibonacci Nim, Mathematics Stack Exchange](https://math.stackexchange.com/questions/2762700/proof-of-winning-strategy-in-fibonacci-nim)
8. [Sums of other subtraction games, lecture notes, Carnegie Mellon University](https://www.math.cmu.edu/~af1p/Teaching/Combinatorics/F03/Class31.pdf)
9. [Every impartial game is a Nim heap, Combinatorial Game Theory](https://www.combinatorial-game-theory.com/essays/sprague-grundy/)
10. [Whinihan (1963). Fibonacci Nim. Fibonacci Quarterly 1:4.](https://www.fq.math.ca/Scanned/1-4/whinihan.pdf)
11. [Fibonacci nim — the ladder, Combinatorial Game Theory](https://www.combinatorial-game-theory.com/ladders/fibonacci-nim/)

---
*Initially written Oct 21, 2026*

Topic: 体育、游戏与休闲 › 棋牌与益智游戏 › 益智游戏

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/fibonacci-nim

English original: https://www.edgepedia.org/fibonacci-nim
