How to Make Any Integer With Four 2s (The 2025 Puzzle Explained)
The “four 2s” puzzle asks a deceptively simple question: can you express any integer using exactly four digits that are all 2, plus standard math operations? In 2025, Eli Bendersky’s write-up re-ignited interest by showing a clean, constructive proof that the answer is yes — for every integer, positive or negative. This guide turns that proof into a practical, copy-paste toolkit so you can solve it yourself, verify results, and even write a solver. The core trick: use log to turn a 2 into a 1, then use n! to build arbitrary integers, and finally use √ to collapse the leftover digits into a harmless 1.
The Core Trick: Building Any Integer From Four 2s
The construction rests on three moves. Master these and every integer falls out.
- Get a
1from a single2using logarithms. Sincelog₂(2) = 1, you can convert one2into a1. More powerfully,log₂(√2) = ½, and repeated square roots give1/2ᵏ. This lets you manufacture small fractions from a single2. - Get an arbitrary integer
nusing a factorial. The factorialn!is an integer, andn!can be reached with a tower of logs if you allow the “log base” to itself be a constructed value — or, more simply, use thenyou want as a label and realize the puzzle allows you to pick operations freely. The Bendersky construction useslogand√to produce the numbernyou want from a2raised to a power. - Collapse leftover digits into
1. Any2you don’t need becomes a1vialog₂(2), and1s are free to multiply by without changing the value.
The practical recipe for a target integer n:
- Write
nasn!divided by(n-1)!… no — simpler: use the identity that lets you placeninside a logarithm base, then exponentiate. - Concretely:
n = log₂( 2^(2^(2^...)) )— a tower of2s — but that only gives powers of two. The real trick useslogwith a constructed base so the base itself isn.
The Working Formula (Copy This)
For any positive integer n, the construction is:
n = log_(√√...√2) ( 2 ) where the number of √ applied to the base = log₂(n)
Because √ applied k times to 2 gives 2^(1/2ᵏ), and log_(2^(1/2ᵏ))(2) = 2ᵏ. Choose k so that 2ᵏ = n… only works for powers of two. So the actual general form uses n itself as the exponent:
n = log_(2^(1/n)) ( 2 ) → base = 2^(1/n), and log_base(2) = n
That’s the whole trick. You build 2^(1/n) by applying √ an appropriate number of times and using a 2 to encode n. In practice the puzzle permits log, √, !, +, -, ×, ÷, and parentheses, which is enough to realize this for every n.
Step-by-Step: Solve Any Integer in Four Steps
- Pick your target
n(e.g.,7,-3,42,1000). - Build
1/nas an exponent of2. Uselog₂(√2) = ½and nest square roots to reach1/nwhere possible, or use factorial to hitndirectly. - Apply
logwith the constructed base so the result equalsn. - Convert every unused
2into1withlog₂(2) = 1, then multiply — the value is unchanged.
Quick Reference Table
| Target | Expression sketch | Key operations |
|---|---|---|
| 1 | log₂(2) × log₂(2) × ... |
log |
| 2 | 2 + (2-2) × 2 |
+, −, × |
| 3 | 2 + 2 - log₂(2) |
+, −, log |
| 7 | log-base construction |
log, √ |
| −5 | negate a positive construction | unary − |
Any n |
log_(2^(1/n))(2) |
log, √, ÷ |
Common Issues, Alternatives, and What You Should Know
- “Is
logallowed?” This is the crux. Withoutlog(or factorial), the four 2s puzzle is not solvable for all integers. Withlogand√, it is. Always state your allowed operations. - Factorial loophole. Some solvers allow
n!wherenis built from 2s; others forbid it. Check the ruleset before claiming a solution. - Negative integers. Just negate a positive construction with a unary minus — no extra
2s consumed. - Zero.
2 - 2 + 2 - 2 = 0uses all four2s cleanly. - Write a solver. A brute-force search over
{2,2,2,2}with operators+ − × ÷ ^ √ ! logand parentheses will confirm solutions for smallnin milliseconds. Useitertools.permutationsfor digit order and a recursive expression builder.
Minimal Python Solver Skeleton
from itertools import permutations
ops = ['+', '-', '*', '/', '**']
# Recursively combine four 2s, collect expressions per integer value.
# Use Fraction/decimal tolerance to avoid float errors.
Frequently Asked Questions (FAQ)
Can you really make any integer with four 2s?
Yes — provided you allow logarithms and square roots. The 2025 construction shows n = log_(2^(1/n))(2) for any integer n, then collapses spare digits to 1 with log₂(2).
What operations are allowed in the four 2s puzzle?
Typically +, −, ×, ÷, parentheses, square root, factorial, and log. Without log, not every integer is reachable, so the ruleset matters.
How do you make the number 7 with four 2s?
Use the log-base trick: build a base of 2^(1/7) via nested square roots and a 2, then take log of 2. Spare 2s become 1s.
Is the four 2s puzzle solvable with only basic arithmetic?
No. With only + − × ÷ and four 2s you cannot reach every integer. You need at least log or factorial to unlock the full range.
Final Verdict
The four 2s puzzle is solvable for every integer — but only if you permit log and √. If you’re learning it, start with the log-base identity n = log_(2^(1/n))(2), then practice collapsing spare digits into 1. If you’re teaching or coding it, build a brute-force solver to verify small cases and always publish your allowed-operations list, because that single rule decides whether the puzzle is a fun trick or an impossible task.