What this calculator does
Collatz conjecture (3n+1) works out steps to reach 1 by halving even numbers and applying 3n + 1 to odd ones. Enter your own figures above and the answer updates as you type: nothing is fixed in the code, so the result reflects exactly the numbers you supply.
The formula this calculator evaluates is printed under the tool and explained below, so you can check the working by hand or reuse it in a spreadsheet.
The formula
The inputs explained
| Field | What to enter |
|---|---|
| Starting number (positive integer) | A number. Starts at 27. |
Worked examples
Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.
How the answer changes with starting number (positive integer)
Every other input is held at the calculator’s starting values while starting number (positive integer) varies. Select any row to load that scenario into the calculator.
| Starting number (positive integer) | Stopping time (steps to reach 1) | Peak value reached | Sequence |
|---|---|---|---|
| 13.5 | 17 | 52 | 14 → 7 → 22 → 11 → 34 → 17 → 52 → 26 … 16 → 8 → 4 → 2 → 1 |
| 20.25 | 7 | 20 | 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1 |
| 27 | 111 | 9,232 | 27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 … 16 → 8 → 4 → 2 → 1 |
| 40.5 | 109 | 9,232 | 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 … 16 → 8 → 4 → 2 → 1 |
| 54 | 112 | 9,232 | 54 → 27 → 82 → 41 → 124 → 62 → 31 → 94 … 16 → 8 → 4 → 2 → 1 |
| 81 | 22 | 244 | 81 → 244 → 122 → 61 → 184 → 92 → 46 → 23 … 16 → 8 → 4 → 2 → 1 |