Report

Help us improve this tool

Collatz Conjecture Calculator

Explore the Collatz conjecture (3n+1 problem) by generating hailstone sequences for any positive integer. Visualize trajectory, stopping time, peak values, and statistics.

O M T

What Is the Collatz Conjecture?

The Collatz conjecture (also known as the $3n+1$ problem, the Syracuse problem, or the hailstone sequence) is one of the most famous unsolved problems in mathematics. It asks a deceptively simple question: does a particular iterative process always reach 1, regardless of the starting positive integer?

Starting with any positive integer $n$, the process is defined as:

$$f(n) = \begin{cases} n/2 & \text{if } n \text{ is even} \\ 3n+1 & \text{if } n \text{ is odd} \end{cases}$$

If $n$ is even, divide it by 2. If $n$ is odd, multiply it by 3 and add 1. Repeat this process with each new value. The conjecture states that no matter what positive integer you start with, you will always eventually reach 1.

How to Use This Calculator

Enter any positive integer in the input field above. The tool will instantly generate the full Collatz sequence, showing every step from the starting number down to 1. You can use the preset buttons to try famous starting values known for their long or interesting sequences.

The results display key statistics including the stopping time (total steps to reach 1), the peak value (the highest number encountered in the sequence), and the growth ratio (peak divided by starting value). A line chart visualizes the sequence, and you can toggle between linear and logarithmic scales to better see patterns when the peak is very large.

Famous Examples

The starting number 27 produces one of the most dramatic sequences: it takes 111 steps to reach 1, and the peak value reaches 9,232. This makes 27 a classic demonstration of the conjecture's unpredictable behavior. Other notable starting values include 871 (peak of 190,996), 6,171 (peak of 975,400), and 77,031 (peak of 2,194,330,516).

Despite being tested for all numbers up to approximately $2^{68}$ (about 295 quintillion) using distributed computing, no counterexample has ever been found. Every starting value tested eventually reaches the cycle $4 \to 2 \to 1$.

Why Is It Unsolved?

The Collatz conjecture remains unproven because it touches on deep questions about the nature of iterated functions and dynamical systems. While the rule is simple, the behavior is chaotic. Numbers can grow unpredictably before eventually descending. The sequence for 27 climbs as high as 9,232 before finally dropping to 1. For 77031, the peak exceeds 2.1 billion.

Mathematicians have proven that almost all Collatz sequences eventually reach a value less than the starting number (the "almost all" result by Terence Tao, 2019), but proving it for every single integer remains out of reach. The problem has been described as "a dangerous problem" by Paul Erdos, who said "mathematics is not yet ready for such problems."

Related Tools

If you enjoy exploring number patterns, try our Prime Factorization Calculator to break numbers into their prime factors, the Fibonacci Numbers Calculator to generate another famous integer sequence, or the Perfect Number Checker to find numbers with special divisor properties.

Frequently Asked Questions

What is the Collatz conjecture in simple terms?

Pick any positive integer. If it is even, divide it by 2. If it is odd, multiply it by 3 and add 1. Repeat this process. The Collatz conjecture says that no matter which number you start with, you will always eventually reach 1.

Why is it called the "hailstone sequence"?

The sequence is called a hailstone sequence because the numbers go up and down like hailstones in a storm cloud before eventually falling to the ground (reaching 1). The rising and falling pattern is similar to how hailstones are tossed up and down by updrafts before they become heavy enough to fall.

Has anyone found a number that does not reach 1?

No. The conjecture has been verified for all starting numbers up to approximately $2^{68}$ (about 295 quintillion) using distributed computing projects. However, because no formal proof exists, it remains a conjecture rather than a theorem.

What is the stopping time of a Collatz sequence?

The stopping time is the number of steps required to reach 1. For example, starting from 10 gives the sequence 10, 5, 16, 8, 4, 2, 1 which has a stopping time of 6 steps. Starting from 27 takes 111 steps, and starting from 77031 takes 349 steps.

Why is the Collatz conjecture so hard to prove?

The process is chaotic and unpredictable. While the rule is simple, the behavior varies wildly depending on the starting number. Some numbers drop quickly to 1, while others soar to enormous heights before descending. Proving that this happens for every single integer requires insights into number theory and dynamical systems that mathematicians have not yet discovered.

Are there variations of the Collatz conjecture?

Yes. The $3n+1$ problem is the most famous version, but mathematicians have studied many variants. For example, the $3n-1$ problem, $5n+1$ problem, and generalizations where the rule depends on the remainder modulo more than 2. Some of these variants are known to have cycles other than 1, making them provably false.