๐ŸŒ€ Collatz Sequence Visualizer

111Steps
9,232Peak value
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

Starting from any positive integer, repeatedly applies the rule "if even, divide by 2; if odd, multiply by 3 and add 1" until reaching 1 โ€” the Collatz conjecture (the 3n+1 problem) โ€” and charts how the value moves over time. It's famous as an unsolved conjecture: every starting positive integer is believed to eventually reach 1, though this has never been proven for all integers.

How to use

  1. Enter a starting positive integer.
  2. The sequence down to 1 is computed automatically, along with the step count and peak value reached.
  3. The chart shows how the value swings up and down along the way.

How the calculation works

The Collatz conjecture, posed by Lothar Collatz in 1937, says that starting from any positive integer and repeating these steps always reaches 1: โ€ข if the number is even, halve it โ€ข if it is odd, multiply by 3 and add 1 Despite the simple rule, it remains unproven. Computers have checked every starting number up to 2โถโธ (about 3 ร— 10ยฒโฐ). This tool computes the sequence from your number (up to 10 million) down to 1 and shows the number of steps, the highest value reached and a line chart of the values. The way they rise and fall on the way to 1 is why they are sometimes called hailstone numbers.

Worked example

6 โ†’ 3 โ†’ 10 โ†’ 5 โ†’ 16 โ†’ 8 โ†’ 4 โ†’ 2 โ†’ 1 (8 steps) Starting from 27 111 steps to reach 1, peaking at 9,232 (a small number that climbs very high before coming down) Powers of two (16, 1024 โ€ฆ) just halve their way straight down to 1.

Things to be aware of

  • Continuing after 1 gives the loop 1 โ†’ 4 โ†’ 2 โ†’ 1.
  • Below 10 million, the longest sequence starts at 8,400,511 (685 steps).
  • Paul Erdล‘s is said to have remarked that "mathematics may not be ready for such problems".

FAQ

What is the Collatz conjecture?

It's an unsolved conjecture in mathematics that repeatedly applying "if even, halve it; if odd, triple it and add 1" to any positive integer will always eventually reach 1. It's named after mathematician Lothar Collatz.

Has this been proven for all numbers?

Computer verification has confirmed it up to enormous starting values, but it has never been proven for all positive integers โ€” it remains an open problem in mathematics.

What happens starting from 27?

27 is a famous example of a surprisingly long sequence for such a small starting number โ€” it takes 111 steps and peaks at 9232 along the way.