Collatz Sequence Calculator

Inputs

A whole number from 1 to 10^15.

Searches every start under this limit, up to 1,000,000.

Results

Steps to reach 1
—
Highest value
—
Odd steps (3n + 1)
—
Longest sequence below the limit
—

The sequence

Take any positive whole number. If it’s even, halve it; if it’s odd, triple it and add 1. Repeat. The Collatz conjecture says you always reach 1 in the end. It has been checked for every number up to about 2^68, but nobody has proved it. The paths are wildly uneven, which is what makes them fun to explore.

How to use it

  1. Enter a starting number.
  2. Read the steps to 1 and the highest value, and follow the path on the chart.
  3. Change the limit to find the start with the longest sequence below it.

Examples: 27 takes 111 steps (41 of them odd) and climbs as high as 9,232 before falling to 1. Below 100, 97 has the longest sequence: 118 steps. Below 1,000, it is 871 with 178 steps; below 1,000,000, 837,799 with 524 steps.

Questions and answers

Has the Collatz conjecture been proved?

No. It is one of the best-known unsolved problems in mathematics. Computers have checked every start up to about 2^68 without finding one that fails, and Terence Tao showed in 2019 that almost all starts reach values close to 1, but a full proof is still missing.

Why is it also called 3n + 1?

Because of the rule for odd numbers. The problem has many names: Collatz, Syracuse, Ulam, Kakutani, and the hailstone sequence, because the values rise and fall like hailstones in a cloud.

Why are some numbers so much longer than their neighbors?

No one can predict it from the number alone, which is part of why the problem is hard. 27 takes 111 steps while 28 takes only 18.

Link with pre-filled values

Add # and these parameters to the end of this page's address to open the tool with values already filled in.

ParameterWhat it sets
nStarting number (1 to 10^15).
belowLimit for the longest-sequence search (up to 1,000,000).

Example: https://toolabelle.com/collatz-sequence/#n=97&below=1000000

Related tools