Collatz Conjecture Calculator – 3x+1 Sequence Explorer

Interactively explore the Collatz conjecture (3x+1 problem). Generate hailstone sequences, visualize trajectories, and inspect stopping times for any starting integer.

Educational · Number theory · Experimental Updated:

Collatz sequence generator

Any positive integer ≥ 1. Classic examples: 6, 7, 19, 27, 871.

Safety cap to avoid runaway sequences. Adjust for research experiments.

Use log scale to visualize large peaks.

Note: This tool is for exploration only and does not constitute a proof of the Collatz conjecture.

Reached 1?

Total stopping time

Steps until first 1

Stopping time

First step below start

Max value reached

Peak of the orbit

Trajectory chart

Enter a starting value to see the orbit.

Sequence table (orbit)

Each row shows one step of the iteration.

Step Value Parity
Sequence data will appear here after you generate a trajectory.

What is the Collatz conjecture?

The Collatz conjecture is one of the most famous unsolved problems in elementary number theory. Starting from any positive integer \(n\), you apply the following rule repeatedly:

Given a positive integer \(n\):

  • If \(n\) is even, set \(n \leftarrow n / 2\).
  • If \(n\) is odd, set \(n \leftarrow 3n + 1\).

In function form: \[ f(n) = \begin{cases} n/2 & \text{if } n \equiv 0 \pmod{2}, \\ 3n+1 & \text{if } n \equiv 1 \pmod{2}. \end{cases} \]

The sequence of values you obtain is sometimes called the Collatz sequence, the 3x+1 sequence or a hailstone sequence, because the values often rise and fall before eventually dropping down to 1, reminiscent of hailstones in a cloud.1

The conjecture claims that no matter which positive integer you start from, the sequence will always reach 1. Once it hits 1, it falls into the trivial loop \(1 \to 4 \to 2 \to 1 \to \dots\).

Stopping time and total stopping time

When exploring Collatz orbits, two statistics are especially useful:

  • Stopping time of \(n\): the smallest number of steps needed for the sequence to first fall below the starting value \(n\).
  • Total stopping time of \(n\): the number of steps needed to reach 1 for the first time.

In this calculator we report both values whenever the sequence reaches 1 before the safety limit on iterations. These quantities are widely used in the research literature to compare how “long” different starting values take to settle down.

Example: starting at n = 6

If you type \(6\) into the calculator, you obtain the sequence \[ 6,\, 3,\, 10,\, 5,\, 16,\, 8,\, 4,\, 2,\, 1. \]

  • The starting value is 6 (step 0).
  • The first time the sequence falls below 6 is at step 1 (value 3), so the stopping time is 1.
  • The first time it reaches 1 is at step 8, so the total stopping time is 8.
  • The maximum value in this orbit is 16.

Why the problem is still unsolved

Despite the extremely simple definition, the Collatz conjecture has resisted proof for decades. It was introduced by German mathematician Lothar Collatz in 1937 and has since attracted the attention of many leading mathematicians.2 The conjecture has been verified by computer for all starting values up to very large limits (over \(2^{68}\) in some published computations), but a general proof or counterexample remains unknown.3

In the words of Jeffrey Lagarias, a leading expert on the problem, the Collatz conjecture appears to be “extraordinarily difficult” and “completely out of reach of present-day mathematics”.1

How to use this Collatz explorer responsibly

This tool is designed primarily for:

  • Teaching and learning about iteration, orbits and discrete dynamical systems.
  • Gaining intuition for stopping times and peak values.
  • Exploratory experimentation in number theory and computer science education.

For serious research, you should rely on dedicated, high-performance implementations that can handle extremely large starting values with careful numerical checks and rigorous record-keeping.

References & further reading

  • Wikipedia, “Collatz conjecture” – formal definition, history and computational records.
  • Quanta Magazine, “The Simple Math Problem We Still Can’t Solve” – accessible overview of the conjecture and recent work.
  • Jeffrey C. Lagarias, “The 3x+1 Problem and Its Generalizations” – research-level survey of the 3x+1 problem.