# Paul Dirac如何用四个2构造任意整数

Original title: Making any integer with four 2s (2025)

> Hacker News story 50408713 · language: zh · submitted 2026-11-07
> Web version: https://zeli.app/zh/story/50408713
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 207 · by [germanrabbit](<https://news.ycombinator.com/user?id=germanrabbit>) · 💬 53
[original](<https://eli.thegreenplace.net/2025/making-any-integer-with-four-2s/>) · [HN discussion](<https://news.ycombinator.com/item?id=50408713>)

## Summary

这是一个有趣的数学谜题：仅用四个数字2和任意数学运算，构造出任意目标自然数。小学生可以用基础运算尝试，中学生加入指数、阶乘后范围扩大，而数学家则引入Gamma函数、复数甚至积分等工具。但真正终结这场游戏的是Paul Dirac在1920年代提出的通用解法：通过嵌套平方根与对数，仅需三个2即可表达任意整数，再巧妙替换为四个2。虽然有人质疑这是“作弊”，但它完全符合谜题规则，且展示了数学的优雅与无限可能。

## Key quote

> 虽然有人声称这是作弊，但这似乎完全符合谜题的规则！

## HN discussion (53 comments)

### [hahajk](<https://news.ycombinator.com/item?id=50409769>)

> 我知道大家都有自己的规则，但在我看来，开平方根也算消耗了一个 2——它不像加号（+）或阶乘（!）那样只是个运算符。因为这里隐含了一个“2”，毕竟你也可以开立方根或四次方根。

### [bajard](<https://news.ycombinator.com/item?id=50411229>)

> 22 是作弊，因为 22 = 2*10+2 在十进制下是任意的。如果你用其他进制写 22，就必须写出进制数，那就会多出一个数字。

### [adas0693](<https://news.ycombinator.com/item?id=50409188>)

> 有一个相关的问题（灵感来自 ITA Software 的面试题，该公司现在是 Google 的一部分），要求找出无法用 N 个数字 K（K 在 [2,9] 之间）通过包含四则运算和括号的表达式表示的最小正整数：+, -, *, /, (, )。
>
> 为了让问题更有趣，运算列表可以扩展为包括幂运算和数字拼接。
>
> 例如，对于 N=4 且 K 在 [2,9] 之间，仅使用四则运算，我们得到：
>
> 7 无法用 4 个 2 算出；
>
> 11 无法用 4 个 3 算出；
>
> 10 无法用 4 个 4 算出；
>
> 8 无法用 4 个 5 算出；
>
> 9 无法用 4 个 6 算出；
>
> 4 无法用 4 个 7 算出；
>
> 5 无法用 4 个 8 算出；
>
> 4 无法用 4 个 9 算出。

### [gnabgib](<https://news.ycombinator.com/item?id=50408765>)

> 去年很火（368 分，165 条评论）https://news.ycombinator.com/item?id=43145753

### [allywilson](<https://news.ycombinator.com/item?id=50411490>)

> 我就把链接丢这儿吧（是的，这里是 4 而不是 2——它们可是好两倍）：https://fourmula.awsum.info/

---

## Cite

- Page: https://zeli.app/zh/story/50408713
- Date: 2026-11-07
- Source: eli.thegreenplace.net (https://eli.thegreenplace.net/2025/making-any-integer-with-four-2s/)
- Hacker News: https://news.ycombinator.com/item?id=50408713

## Other languages

- en: https://zeli.app/story/50408713 · markdown: https://zeli.app/story/50408713.md
- ja: https://zeli.app/ja/story/50408713 · markdown: https://zeli.app/ja/story/50408713.md
- ko: https://zeli.app/ko/story/50408713 · markdown: https://zeli.app/ko/story/50408713.md
- de: https://zeli.app/de/story/50408713 · markdown: https://zeli.app/de/story/50408713.md
- es: https://zeli.app/es/story/50408713 · markdown: https://zeli.app/es/story/50408713.md
- ru: https://zeli.app/ru/story/50408713 · markdown: https://zeli.app/ru/story/50408713.md
