StatGardenREF. DESK
Calculators/Maths/Collatz conjecture (3n+1)
Maths

Collatz conjecture (3n+1) calculator

Steps to reach 1 by halving even numbers and applying 3n + 1 to odd ones.

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

FormulaWhile n ≠ 1: n → n/2 if n is even, n → 3n + 1 if n is odd

The inputs explained

FieldWhat 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.

How the answer changes with starting number (positive integer)
Starting number (positive integer)Stopping time (steps to reach 1)Peak value reachedSequence
13.5175214 → 7 → 22 → 11 → 34 → 17 → 52 → 26 … 16 → 8 → 4 → 2 → 1
20.2572020 → 10 → 5 → 16 → 8 → 4 → 2 → 1
271119,23227 → 82 → 41 → 124 → 62 → 31 → 94 → 47 … 16 → 8 → 4 → 2 → 1
40.51099,23241 → 124 → 62 → 31 → 94 → 47 → 142 → 71 … 16 → 8 → 4 → 2 → 1
541129,23254 → 27 → 82 → 41 → 124 → 62 → 31 → 94 … 16 → 8 → 4 → 2 → 1
812224481 → 244 → 122 → 61 → 184 → 92 → 46 → 23 … 16 → 8 → 4 → 2 → 1