Collatz Conjecture Calculator

Explore the 3x+1 problem and generate hailstone sequences

Generate Collatz Sequence

Try any positive integer (e.g., 7, 11, 27)

Safety limit to prevent infinite loops

Collatz Sequence Results

17
Sequence Length
11
Stopping Time
52
Peak Value
Reached 1

Hailstone Sequence

7221134175226134020105168421

✅ Conjecture Confirmed!

The sequence reached 1 after 16 steps, supporting the Collatz conjecture.

Famous Collatz Examples

Starting with 7

Sequence: 7 → 22 → 11 → 34 → 17 → 52 → 26 → 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1

Length: 17 steps

Peak: 52

Starting with 11

Sequence: 11 → 34 → 17 → 52 → 26 → 13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1

Length: 15 steps

Peak: 52

Starting with 27

Sequence: 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 → 445 → 1336 → 668 → 334 → 167 → 502 → 251 → 754 → 377 → 1132 → 566 → 283 → 850 → 425 → 1276 → 638 → 319 → 958 → 479 → 1438 → 719 → 2158 → 1079 → 3238 → 1619 → 4858 → 2429 → 7288 → 3644 → 1822 → 911 → 2734 → 1367 → 4102 → 2051 → 6154 → 3077 → 9232 → 4616 → 2308 → 1154 → 577 → 1732 → 866 → 433 → 1300 → 650 → 325 → 976 → 488 → 244 → 122 → 61 → 184 → 92 → 46 → 23 → 70 → 35 → 106 → 53 → 160 → 80 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1

Length: 112 steps

Peak: 9,232

Starting with 31

Peak Value: 9,232 (after many steps)

Length: 107 steps to reach 1

This number demonstrates the wild "hailstone" behavior with dramatic ups and downs!

The Collatz Rules

If n is even:
n → n ÷ 2
If n is odd:
n → 3n + 1
Goal:
Continue until reaching 1

Quick Facts

🔢

Also known as

3x+1 problem, Hailstone sequence, Syracuse problem

🎯

Conjecture

Every positive integer eventually reaches 1

🔬

Tested up to

2^95 ≈ 295 quintillion

Status

Unproven - still an open problem!

Key Terms

Stopping Time

Steps to reach a value smaller than starting number

Total Stopping Time

Steps to reach 1 for the first time

Hailstone

Name for the up-and-down pattern like hail in clouds

4-2-1 Loop

The final cycle: 4 → 2 → 1 → 4 → 2 → 1...

Understanding the Collatz Conjecture

What is the Collatz Conjecture?

The Collatz conjecture, also known as the 3x+1 problem, is one of the most famous unsolved problems in mathematics. It states that no matter what positive integer you start with, if you repeatedly apply the simple rules, you will always eventually reach the number 1.

The Rules

  • If the number is even: Divide it by 2
  • If the number is odd: Multiply by 3 and add 1
  • Repeat: Continue until you reach 1

Why "Hailstone"?

The sequences are called "hailstone sequences" because they resemble the chaotic up-and-down movement of hailstones in storm clouds before finally falling to the ground (reaching 1).

The Mathematical Mystery

Simple Rules, Complex Behavior

Despite the simple rules, predicting the behavior of any given starting number is impossible without computing the sequence.

Extensive Testing

Every number tested so far (up to 2^95) has eventually reached 1, but no general proof exists.

Chaotic Nature

Small changes in starting numbers can lead to dramatically different sequence lengths and peak values.

Warning!

Many mathematicians have become obsessed with this problem. As the XKCD comic warns: "Don't spend too much time on it - it's a mathematical rabbit hole!"

Special Cases and Patterns

Powers of 2

Numbers like 2, 4, 8, 16, 32... have predictable, monotonically decreasing sequences.

16 → 8 → 4 → 2 → 1

Negative Numbers

Negative integers can enter cycles and never reach 1:

-1 → -2 → -1 → -2...

-5 → -14 → -7 → -20...

Record Holders

Some numbers have exceptionally long sequences or high peaks:

27 reaches 9,232 (112 steps)

63,728,127 has 949 steps

Formal Definition

The Collatz function C(n) is defined as:

C(n) = ⎨ n/2        if n ≡ 0 (mod 2)
         ⎩ 3n + 1    if n ≡ 1 (mod 2)

Conjecture: For any positive integer n, there exists some k ≥ 0 such that C^k(n) = 1, where C^k denotes applying the function C exactly k times.