Collatz Conjecture Calculator
Find the Collatz steps for a number.
Result
How it is calculated
The Collatz rule is applied repeatedly to a starting integer n: if n is even, replace it with n / 2; if odd, replace it with 3n + 1. The tool counts how many applications it takes to reach 1 (steps) and records the largest value seen along the way (peak, which includes the starting number). Decimals are cut to a whole number, and the start must be at least 1. The loop stops after 100,000 steps as a safety limit. Whether every start reaches 1 is the unproven Collatz conjecture; every number tested so far does.
Worked example
Start at 27. The path begins 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214 and keeps climbing in bursts. After 111 steps it finally reaches 1, and the highest value it touched along the way is 9,232. So a small start of 27 climbs more than 340 times higher before falling back.
Common mistakes
- Starting with 0 or a negative number; the rule is only defined here for positive integers.
- Counting the starting number as a step; steps count transformations, so reaching 1 from 2 is 1 step.
- Confusing the peak with the final value; the end is always 1, while the peak is the maximum along the path.
- Entering a decimal such as 27.9 and expecting it to be rounded up; it is truncated to 27.
About this calculator
This calculator runs the Collatz conjecture sequence (also called the 3n+1 problem) on any starting number: if it's even, divide by 2; if it's odd, multiply by 3 and add 1. Repeat until you hit 1, and the calculator reports the number of steps and the highest value reached along the way.
It's a famous unsolved problem in mathematics — every number tested so far eventually reaches 1, but no one has proven it's true for all numbers. Math enthusiasts, students, and programmers use this calculator to explore the sequence and see how wildly the peak value can spike before collapsing back down.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)