# Paul Dirac ruined a beloved math puzzle by solving it for every number

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

> Hacker News story 50408713 · language: en · submitted 2026-11-07
> Web version: https://zeli.app/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

The four 2s puzzle asks you to build any integer using exactly four 2s and mathematical operations. It entertained mathematicians in the 1920s until Paul Dirac found a general solution using nested square roots and base-2 logarithms. His formula uses only three 2s, but you can fix that by replacing a digit with a clever expression. The trick is simple, elegant, and arguably cheating.

## Key quote

> Until Paul Dirac ruined it for everyone by finding a general solution for every number.

## HN discussion (53 comments)

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

> i know everyone plays with their own rules, but from my perspective, a square root spends a 2 - it's not an operator like + or ! . there's an implicit "2" since you could also take the cube root or fourth root

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

> 22 is cheating because 22 = 2*10+2 is arbitrary in base 10. If you write 22 in some base, you have to write the base, and that's an extra number.

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

> there is a related problem (inspired by an interview questions from ITA software, a part of Google now) that asks to find the smallest positive integer that cannot be expressed using a digit K (in [2,9]) N times in an expression that involves the four basic arithmetic operations and the parentheses: +, -, *, /, (, and ).
>
> to make the problem more interesting, the list of operations can be extended to include exponentiation and concatenation.
>
> for example, using the four basic operations for N=4, and K in [2,9], we get:
>
> 7 cannot be computed in 4 2s; 
>
> 11 cannot be computed in 4 3s; 
>
> 10 cannot be computed in 4 4s; 
>
> 8 cannot be computed in 4 5s; 
>
> 9 cannot be computed in 4 6s; 
>
> 4 cannot be computed in 4 7s; 
>
> 5 cannot be computed in 4 8s; 
>
> 4 cannot be computed in 4 9s;

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

> Popular last year (368 points, 165 comments) https://news.ycombinator.com/item?id=43145753

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

> I'll just drop this here (yes, it's 4 instead of 2 - they're twice as good): https://fourmula.awsum.info/

---

## Cite

- Page: https://zeli.app/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

- zh: https://zeli.app/zh/story/50408713 · markdown: https://zeli.app/zh/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
