Thought Toys · Chaos & fractals · Exhibit 77

3n+1 always comes home. Swap in a 5, and it mostly doesn't.

Take any number. If it's even, halve it; if it's odd, triple it and add one. Repeat. Every number ever tested — up to 300,000 of them — eventually reaches 1. Keep the exact same rule but swap that 3 for a 5, and most numbers never come home at all.

One trajectory, step by step

Every start from 2 to 150, same rule reaches 1 never does chosen start

step(n) = n/2 if even, else k·n+1
Try a start
your turn — switch to k = 5 and try a few starts

What you're seeing

The rule is deliberately tiny: if the current number is even, halve it; if it's odd, multiply it by k and add one. Start from n₀ and repeat. The top chart traces exactly that, one step at a time, value on a log scale so both the small numbers and the occasional huge spike stay visible on the same chart. At k=3 — the famous "Collatz" rule — the path can wander a long way before it commits: 27 claws up to 9,232, 342 times its own starting value, before it finally tumbles down to 1 after 111 steps. Try the neighboring numbers 26 and 27 back to back: 26 reaches 1 in a mere 10 steps, 27 takes 111. Two numbers one apart, wildly different journeys — non-monotonic, in the same way a coastline is jagged rather than smooth.

The bottom chart zooms out to a whole population: one thin bar for every starting number from 2 to 150, height equal to its stopping time. At k=1 and k=3, every single bar is cyan — every tested start reaches 1, some quickly, some (like 27, or 129 at 121 steps) only after a long climb. Switch to k=5 and watch the chart turn mostly red: bars that reach the very top of the chart are starting numbers that never make it to 1 at all. Within this window of 149 starting numbers, only 26 (17%) still reach 1; 23 (15%) fall into one of several exact repeating loops that skip 1 entirely; and 100 (67%) — most of them — climb straight past a trillion within the step budget and show no sign of stopping.

That's the whole point of the toy: the k=3 rule looks so simple that "does it always come back to 1?" seems like it should have an easy answer, and every number anyone has ever checked — far more than the 300,000 checked here — says yes. But nobody has proved it for every number, and this exhibit doesn't pretend otherwise: verified over a range, not proven in general, is an honest and very different claim. Nudge one digit of the rule from 3 to 5, keeping everything else identical, and "always comes back" stops being true even in the tested range — a reminder that "verified so far" and "true for a reason" are not the same guarantee, and that even a one-character change to a simple rule can flip its entire long-run behavior.

The rule, exactly. For odd multiplier k, step(n) = n/2 if n even, else k·n + 1 iterated from n₀ until it first reaches 1 (or is shown not to). Verified in node (improve/verify/77-collatz.js, 15 checks): every start from 1 to 300,000 reaches 1 under k=1, provably fast (an odd number is always immediately followed by an even one, so it can never "bump" twice running); every start from 1 to 300,000 also reaches 1 under k=3 — the longest stopping time found is 442 steps, at n=230,631, and the largest peak-to-start ratio is 107,860.7×, at n=159,487; the non-monotonic landscape is confirmed directly, with an adjacent jump from 10 steps (n=26) to 111 (n=27) and a drop right back to 18 (n=28). The known-bad case, k=5: a starting value under 2,000 (n=5) is found whose trajectory never reaches 1 — not "hasn't yet," but a genuine closed cycle, confirmed two independent ways: replaying it 10 steps from 26 returns exactly to 26, and the cycle {26, 13, 66, 33, 166, 83, 416, 208, 104, 52} provably excludes 1 entirely. Across 1 to 2,000 under k=5: only 114 (5.7%) reach 1, 143 (7.2%) fall into a non-1 cycle, and 1,743 (87.2%) escape past 10¹² within the step budget — the same qualitative split the smaller on-page window shows.

Also in Chaos & fractals: The double pendulum →

All 7 in Chaos & fractals
  1. 03The double pendulum
  2. 08The logistic map
  3. 20The Mandelbrot set
  4. 34Newton's fractal
  5. 50Two nearly identical starts, torn apart
  6. 74Push straight down, and it decides to lean
  7. 773n+1 always comes home. Swap in a 5, and it mostly doesn't. — you are here

← the cabinet · Thought Toys — a cabinet of explorable explanations. Exhibit 77.