Collatz conjecture: steps to reach 1 for every start up to 10,000, with record holders highlighted

Choose any positive whole number. If it’s even, divide it by 2. If it’s odd, multiply it by 3 and add 1. Then repeat. The Collatz conjecture says that wherever you start, you always end up at 1.

Nobody has proved it. So I did the next best thing a programmer can do: I wrote about 60 lines of Python, tested them against known answers, and checked every starting number below 10 million. It took about five seconds on a laptop.

Every one of them reached 1. Then I changed a single sign in the rule, and two-thirds of the numbers I tried never got there. That second result is the one that explains why checking, however much of it, can’t settle the question.


Understanding the Collatz conjecture rule

For a positive integer n, the next value is n / 2 when n is even, and 3n + 1 when n is odd. Once you reach 1, the rule loops forever: 1 → 4 → 2 → 1. Starting from 3 gives a short complete path:

3 → 10 → 5 → 16 → 8 → 4 → 2 → 1

Starting from 6 joins the same path one step in. Paths merge like this all the time, which is what makes a fast search possible.

Collatz conjecture paths for numbers under 50 merging into the same route to 1
Several Collatz paths eventually merge into the same familiar route. Diagram by Keenan Pepper, public domain, via Wikimedia Commons.

The problem is also called the 3x + 1 problem, the Syracuse problem and Ulam’s problem. Jeffrey Lagarias’ overview of the 3x+1 problem is the standard introduction.

Why 27 is the example everyone remembers

Start at 27 and the path wanders for 111 steps before it reaches 1. On the way it climbs as high as 9,232, more than 340 times its starting value. A rule that looks as if it should shrink numbers can send them on a long, wild detour first.

One convention to watch: some papers use a shortcut map that combines each odd step with the halving that always follows it. It’s the same conjecture, but the step counts and peaks change. Under that shortcut, 27 peaks at 4,616. Everything in this post uses the plain rule above.

Checking 10 million numbers in five seconds

Following every path all the way to 1 is wasteful, because most paths quickly fall into territory you’ve already explored. The trick is to walk only until the value drops below the starting number. At that point you already know how many more steps it needs, so you add them on and stop:

def survey(limit):
    """Steps to reach 1 for every start below limit, reusing earlier answers."""
    steps = array("i", [0]) * limit
    longest = (1, 0)          # (start, steps)
    highest = (1, 1)          # (start, peak)
    records = []              # starts that take more steps than every smaller start
    for start in range(2, limit):
        n, s, peak = start, 0, start
        while n >= start:     # walk until we drop below start, where the answer is known
            n = n // 2 if n % 2 == 0 else 3 * n + 1
            s += 1
            if n > peak:
                peak = n
        total = s + steps[n]
        steps[start] = total
        if total > longest[1]:
            longest = (start, total)
            records.append((start, total))
        if peak > highest[1]:
            highest = (start, peak)
    return steps, longest, highest, records

A shortcut like that is exactly where bugs hide, so before trusting any output I tested it against answers that are already known. One test runs the slow, obvious method for every start below 5,000 and checks that both agree. Others check 27, the longest path below a million, and the published list of record holders (OEIS A006877):

test_27_takes_111_steps_and_peaks_at_9232 ... ok
test_3n_minus_1_has_loops_other_than_1 ... ok
test_3n_plus_1_below_100k_only_ever_reaches_the_1_4_2_loop ... ok
test_5n_plus_1_loops_from_13 ... ok
test_longest_below_a_million_is_837799 ... ok
test_record_holders_match_the_published_list ... ok
test_short_paths ... ok
test_survey_matches_the_slow_way ... ok
----------------------------------------------------------------------
Ran 8 tests in 3.021s

OK

What 10 million Collatz conjecture paths look like

The full run, every start from 2 to 9,999,999, took 5.2 seconds. Every one reached 1. Here’s the longest path below each power of ten:

Starts belowLongest path starts atSteps
10919
10097118
1,000871178
10,0006,171261
100,00077,031350
1,000,000837,799524
10,000,0008,400,511685

Each extra digit adds somewhere between 60 and 175 steps to the record, not ten times as many. Most numbers are far more ordinary. The average start needs 155 steps, and three in four need fewer than 200:

Steps to reach 1StartsShare
0 to 992,030,88320.31%
100 to 1995,686,98856.87%
200 to 2992,077,88220.78%
300 to 399194,1001.94%
400 to 4999,5400.10%
500 to 5995920.01%
600 to 69914under 0.001%

Only 53 numbers below 10 million set a new record for path length, and they get rarer the higher you go. The most dramatic climb belongs to 6,631,675. It takes 576 steps and peaks at 60,342,610,919,632, about 9.1 million times its starting value, before coming all the way back down.

Graph showing the number of Collatz steps needed to reach 1 for starting values from 2 to 200
Steps needed to reach 1 for starts from 2 to 200. Diagram by P. Gibellini, public domain, via Wikimedia Commons.

Ten million numbers, ten million confirmations. That’s evidence, not a proof.

Change one sign and the pattern breaks

Here’s the experiment I find most convincing. Keep everything the same, but make odd numbers go to 3n − 1 instead of 3n + 1. I checked every start below a million:

Where the path ends up (3n − 1 rule)StartsShare
Loop of 18 numbers through 17, 50, 25 …348,97034.9%
Loop 1 → 2 → 1327,67932.8%
Loop of 5 numbers: 5 → 14 → 7 → 20 → 10323,35032.3%

Under this rule, the numbers 1 to 4 all reach 1, and 5 is the first that doesn’t. If you’d only tried 1 to 4, you’d have “confirmed” a false conjecture.

Try 5n + 1 and it’s stranger still. Starting at 13 gives a loop of ten numbers that never touches 1. Of the starts below 10,000, only 726 settled into any loop at all. The rest just kept growing: from 7, after nearly 10,000 steps, the value had 319 digits.

So the property “every number reaches 1” isn’t something rules of this shape get for free. It’s a specific claim about 3n + 1, and the two ways the cousins fail (a different loop, or endless growth) are exactly the two ways a Collatz counterexample could work.

What computers have verified so far

My 10 million is tiny. David Bařina’s 2025 paper in The Journal of Supercomputing reports that every start below about 271, roughly 2.4 sextillion numbers, has been checked and reaches 1. That’s extraordinary evidence. It’s still a finite calculation, and a counterexample, if one exists, could sit above the checked range.

Why the Collatz conjecture is so hard to prove

There’s an appealing argument. Even numbers halve. An odd number becomes 3n + 1, which is even, so it’s halved at least once straight after. If odd and even steps came up like fair coin flips, the halvings would win in the long run and every path would shrink.

But the steps aren’t coin flips. They’re fixed by the number itself, and a proof has to rule out every possible exception, including one with a rare, highly structured run of odd steps. The 3n − 1 experiment shows why: the same coin-flip argument applies to it, and it still has loops that avoid 1.

The strongest result so far is Terence Tao’s 2019 paper. In a precise technical sense, he showed that almost all Collatz paths eventually fall below any bound you choose, however slowly that bound grows. “Almost all” is doing a lot of work there: it leaves room for exceptions, and a single exception would disprove the conjecture. Tao’s own write-up on his blog gives a readable overview.

What a Collatz conjecture experiment can and can’t tell you

After my run, the honest statement is: every starting value below 10,000,000 reaches 1 under the 3n + 1 rule, checked by a method that agrees with the slow way below 5,000 and matches the published record holders. The dishonest statement is: every positive integer reaches 1.

That gap matters outside mathematics too. A big test suite gives strong confidence about the inputs it covers, not a guarantee about all of them. It’s the same reason a passing result in AI agent evaluation doesn’t prove the agent got there the right way.

If you want to try this yourself, three habits help:

  • Test the clever version against the obvious version on a small range before you trust it on a big one.
  • Check your results against published values, such as the record holders in OEIS.
  • Write down exactly what your run covers, and claim nothing beyond it.

Sources and further reading

Leave A comment

Are you human? Please solve:Captcha