JESUS CHRIST IS THE ONLY TRUE GOD
Math calculator

Collatz Calculator

Iterate the Collatz rule for a positive safe integer and report steps to reach 1.

Your calculationPrivate in your browser
Report a result

Start with a worked example

Open the worked example for Steps to reach 1. The example starts with Positive integer = 27.

Collatz Calculator formula

If n is even, n→n/2; if n is odd, n→3n+1. Repeat until 1 or the safety limit.

Inputs and units

Inputs and example values for Collatz Calculator
InputFormat / rangeExample
Positive integerWhole number, min 1, max 900719925474099127

Worked example

The values listed in Inputs and units give 111 steps for Steps to reach 1.

Steps to reach 1
111 steps
Peak value
9232
Sequence preview
27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 → 214 → 107 → 322 → 161 → 484 → 242 → 121 → 364 → 182 → 91 → 274 → 137 → 412 → 206 → 103 → 310 → 155 → 466 → 233 → 700 → 350 → 175 → 526 → 263 → 790 → 395 → 1186 → 593 → 1780 → 890 → …

Results and assumptions

Change Positive integer from 27 to 30 and keep the other example inputs fixed. The updated answer is 18 steps (Steps to reach 1).

Fix an input or unexpected result

Positive integer is required. Enter positive integer using the format and bounds in the input table. Zero and an empty field are different: use zero only if it is allowed and represents your data.

See how to check a result or report an issue.