Skip to content
Toolcroft

Math Calculators

Collatz Conjecture Sequence Visualizer - 3n+1 Problem

Visualize the Collatz sequence for any positive integer. See the hailstone trajectory, step count, and peak value. Explore the famous 3n+1 conjecture.

Steps: 111
Max value: 9,232
Max at step: 77
Try:

What is the Collatz conjecture?

Start with any positive integer n. Apply the following two rules repeatedly:

  • If n is even, divide it by 2.
  • If n is odd, multiply it by 3 and add 1.

The Collatz conjecture states that this process will eventually reach 1 for every positive integer, no matter how large. Once it reaches 1, the sequence cycles: 1 -> 4 -> 2 -> 1. Proposed by German mathematician Lothar Collatz in 1937, the conjecture has been verified computationally for all integers up to at least 2⁵⁶ but remains unproven as of 2026. It is one of the most famous unsolved problems in mathematics.

How to read the visualization

Enter a starting number and the chart plots the entire sequence from that number down to 1. The x-axis shows the step number (iteration count); the y-axis shows the value of the sequence at each step. Sequences that reach very high values before descending produce tall spikes - the sequence is not necessarily “long” just because it rises high. The stopping time (number of steps to reach 1) is the key metric of complexity.

Notable starting numbers

  • 27: reaches a peak of 9,232 and takes 111 steps to reach 1 - the longest stopping time of any number below 100.
  • 871: peaks at 190,996 and takes 178 steps.
  • 6,171: 261 steps to reach 1.
  • Powers of 2: extremely short sequences - a power of 2 just halves to 1 with no odd steps.

Why it matters

The Collatz conjecture is remarkable because the rule is trivially simple yet the sequence behaves in a chaotic, unpredictable way. Mathematicians have connected it to deep questions in number theory, dynamical systems, and computational complexity. Paul Erdős reportedly said: “Mathematics is not yet ready for such problems.” Despite its apparent simplicity, no proof or counterexample is known.

Comparison mode

When comparing two starting numbers side by side, you can see how dramatically different starting values produce sequences of very different lengths. A striking example is comparing 27 (which takes 111 steps and reaches a peak of 9,232 before descending) with a nearby power of 2 like 32 (which descends immediately in just 5 steps: 16 -> 8 -> 4 -> 2 -> 1). Powers of 2 always descend monotonically because dividing by 2 repeatedly is the only operation that applies.

Stopping time distribution

The stopping time (also called the "total stopping time") of a number n is the number of steps required to reach 1. Plotting stopping times for all integers from 1 to some large N reveals no obvious pattern - there are erratic spikes and valleys with no simple formula predicting the stopping time of a given n. This apparent randomness in a deterministic rule is central to why the conjecture is so difficult to prove. Numbers with long stopping times are sometimes called "champion" numbers (e.g., 27, 703, 871, 6171).