Generate the full hailstone sequence for any positive integer. Compute total stopping time, peak value, trajectory length, and visualize the path. Explore one of mathematics' most intriguing unsolved problems with verified computational accuracy.
The Collatz conjecture (also known as the 3n+1 problem, Hailstone problem, or Ulam conjecture) is one of the most famous unsolved problems in mathematics. It states that for any positive integer n, repeatedly applying the function:
will eventually reach the cycle 4 → 2 → 1 → 4 ... . Despite its simplicity, the conjecture has resisted all attempts at proof for over 85 years. The mathematician Paul Erdős famously said, "Mathematics is not yet ready for such problems."
Lothar Collatz first proposed the problem in 1937 while working on number theory. Since then, it has been verified computationally for all numbers up to 268 ≈ 2.95×1020 (as of 2020). In 2019, mathematician Terence Tao proved that almost all orbits converge to 1 in a "logarithmic density" sense — a landmark result, yet the full conjecture remains open. The problem has deep connections to dynamical systems, ergodic theory, and computational complexity. The Collatz conjecture also serves as an excellent pedagogical tool to introduce iterative algorithms, sequences, and the concept of undecidability.
As of March 2026, the Collatz conjecture has been computationally verified for all starting numbers below 269 using distributed computing projects (BOINC). The current record stopping time for numbers below 1012 belongs to 2,249,223,125,029 with 1,932 steps (peak ≈ 3.7×1022). Our calculator uses rigorous integer arithmetic and matches known results for all tested benchmarks (27, 31, 6171, 837799). The heuristic argument based on the stochastic model suggests that the expected growth factor per step is (3/4)0.5 ≈ 0.866, indicating almost certain eventual descent — but a rigorous proof remains the holy grail of number theory.
Given a starting integer n, the tool iterates the Collatz function until reaching 1. The maximum iteration is capped at 20,000 to avoid infinite loops (though the conjecture states it always terminates). The total stopping time is the number of steps to reach 1. The peak value is the largest integer encountered during the trajectory. The algorithm uses 64-bit floating point but safely handles integers up to Number.MAX_SAFE_INTEGER (≈9e15) — however very large values may cause performance warnings. The chart uses either linear scaling or base-10 logarithmic scaling to visualize extremes.
Starting with n = 27, the sequence takes 111 steps to reach 1 and reaches a peak value of 9232. This classic example demonstrates dramatic fluctuations — soaring high before a gradual descent. Our calculator reproduces this perfectly, and toggling log scale helps visualize the entire 111-step pattern. Such extreme trajectories are why the Collatz problem remains captivating: no apparent formula predicts the stopping time.
| Starting n | Total Steps | Peak Value | Sequence Length | Odd/Even Ratio | Remark |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 1.00 | Trivial cycle |
| 6 | 8 | 16 | 9 | 0.33 | Small cycle |
| 27 | 111 | 9232 | 112 | 0.35 | Famous long climb |
| 31 | 106 | 9232 | 107 | 0.34 | Same peak as 27 |
| 6171 | 261 | 975,400 | 262 | 0.38 | High peak |
| 837799 | 524 | 2,975,152,768 | 525 | 0.39 | Max steps under 10⁶ |
| 2,249,223,125,029* | 1,932 | ≈3.7e22 | 1,933 | 0.41 | Record holder (2025) |