Collatz Conjecture (3n+1) Sequence
Everyday
The Collatz conjecture, also called the 3n+1 problem or the hailstone sequence, applies a simple rule to a positive integer: if it is even, divide by two; if it is odd, multiply by three and add one. Repeat and, as far as anyone has tested, you always reach 1. Enter a starting number and this tool lists the entire sequence, counts the steps (the stopping time), and reports the highest value reached along the way. Arbitrarily large numbers are handled exactly with big integers. Everything is computed locally in your browser.
How to use
- Enter a positive whole number.
- Read the number of steps, the peak value and the sequence length.
- Scroll the full sequence and copy it with one click.
- Try famous starters like 27 (111 steps, peak 9232) to see how wildly the path can swing.
Frequently asked questions
- What is the rule exactly?
- Start with any positive integer n. If n is even, the next term is n / 2; if n is odd, the next term is 3n + 1. Repeat until you reach 1. The number of steps to reach 1 is called the total stopping time.
- Does every number reach 1?
- It is conjectured — and verified for every number ever tested by computers — but never proven in general. That open question is the Collatz conjecture.
- Why does 27 take so long?
- Although 27 is small, its sequence climbs to a peak of 9232 and takes 111 steps before falling to 1, which makes it a popular example of how unpredictable the path can be.
Related tools
Tile Calculator
Work out how many floor or wall tiles you need for a room — from its length and width and the tile size, with an adjustable waste allowance and boxes required.
Compound Interest Calculator
Project how a starting balance grows with regular contributions, your interest rate, and your compounding frequency.
Age Calculator
Calculate exact age in years, months, days — and find your next birthday.
BMI Calculator
Calculate Body Mass Index from height and weight, with a healthy range.
Tip Calculator
Calculate the tip and split the total bill between people.
Percentage Calculator
Work out percentages, what-percent, and percent change in one place.