DigitHelm
Number Theory

Collatz Sequence Calculator | 3n+1 Conjecture, Stopping Time & Path

Explore the Collatz conjecture (3n+1 problem) for any positive integer. Computes the complete sequence path, stopping time, total steps, peak value, and odd-step count. Visualizes the trajectory and lets you compare stopping times across a range of starting values.

Instant Results100% FreeAny DeviceNo Sign-up

Collatz Sequence Calculator

Range Comparison — Stopping Times (1 to N)

What Is the Collatz Sequence Calculator | 3n+1 Conjecture, Stopping Time & Path?

The Collatz conjecture (also known as the 3n+1 problem or Syracuse problem) states that, starting from any positive integer n, repeatedly applying the Collatz function will eventually reach 1. Despite its simple rule, no proof exists yet. For every n tested (up to 2⁶⁸), the sequence terminates, but no one has proven it for all n. The stopping time is the number of steps to reach 1. The peak (or maximum) value can far exceed the starting number — n=27 reaches a peak of 9232 before descending.

Formula

If n is even: n → n/2   |   If n is odd: n → 3n + 1   |   Repeat until n = 1

How to Use

  1. 1

    Type a positive integer n (1 to 1,000,000,000) into the input field or click one of the presets (n=27, n=871, n=6171).

  2. 2

    Click Compute to run the Collatz algorithm and see the stopping time, peak value, odd/even step counts.

  3. 3

    Read the sequence display — the first 50 steps are shown; for longer sequences, the remaining step count is noted.

  4. 4

    Scroll to the Range Comparison section and set N (2–200) to compare stopping times for all starting values from 1 to N.

  5. 5

    Click "1–50", "1–100", or "1–150" to load preset ranges into the bar chart immediately.

  6. 6

    The bar chart shows each starting value n on the left, a bar proportional to its stopping time, and the exact count on the right.

  7. 7

    Try n=27 (famous for 111 steps and a peak of 9232) and compare with its neighbors to see how erratic stopping times can be.

Enter any positive integer up to 1,000,000,000, click Compute, and explore the full sequence, stopping time, and range comparison chart.

Example Calculation

For n = 27: the sequence is 27 → 82 → 41 → 124 → 62 → 31 → 94 → 47 → 142 → 71 → 214 … (peaks at 9232 on step 76) → … → 1. Stopping time = 111 steps. Odd steps = 34, even steps = 77. Compare with n = 28: stopping time = 18 steps — a neighbour with a wildly shorter path.

Understanding Collatz Sequence | 3n+1 Conjecture, Stopping Time & Path

Famous Starting Values and Their Stopping Times

nStopping TimePeak ValuePeak StepNotable For
1010Trivial fixed point
2120Shortest non-trivial path
37162First odd number > 1
271119,23276Famous for long path and high peak
971189,232113Shares peak with n=27
871178190,996170Highest peak for n < 1000
6171261975,400258Long path under 10000
7703135021,933,016348Record stopping time under 100000

Stopping Time Statistics for n = 1 to 20

nStopping TimePeakOdd StepsEven Steps
10100
21201
371625
42402
551623
681626
71652511
83803
91952514
1061624
111452410
1291627
1394036
141752512
1517160512
1641604
17125239
182052515
192088515
2072025

Key Facts and Related Sequences

  • The Collatz function is T(n) = n/2 if n ≡ 0 (mod 2), or (3n+1)/2 if n ≡ 1 (mod 2) in its "shortcut" form, which skips the intermediate even number after each odd step.
  • Stopping time records below 10⁶: the number 837799 has stopping time 524 and peak 2,974,984,576.
  • The average stopping time for n < N grows roughly as 9.48 ln N.
  • The total stopping time problem asks for the number of steps to enter the cycle {4, 2, 1}. The sequence A006577 in OEIS.
  • Paul Erdős said "Mathematics is not yet ready for such problems" about the Collatz conjecture.

Frequently Asked Questions

Has the Collatz conjecture been proved?

No. Despite being verifiable for all n up to 2⁶⁸ and extensive partial results (including Tao's 2019 "almost all" proof), no complete proof or counterexample has been found. It remains one of the most famous unsolved problems in mathematics.

What is the "stopping time" of a number?

The stopping time is the number of Collatz steps required to reach 1 from a given starting value n. For example, n=1 has stopping time 0, n=2 has stopping time 1, and n=27 has stopping time 111.

Why does n=27 have such a long sequence?

n=27 is famous for its unexpectedly long journey: it requires 111 steps and reaches a peak of 9232 — more than 341× the starting value — before eventually descending to 1. This illustrates how stopping times are highly unpredictable from the starting value alone.

Can n ever increase indefinitely?

No counterexample has been found. For every n tested up to 2⁶⁸, the sequence always reaches 1. The conjecture asserts this holds for all positive integers, but the proof remains elusive.

What is the maximum value the calculator supports?

The calculator supports any positive integer up to 1,000,000,000 (10⁹), which fits exactly in JavaScript's 64-bit floating point. For safety, sequences are capped at 10,000 steps (though no number below 10⁹ is known to exceed this limit).

You Might Also Like

Explore 360+ Free Calculators

From math and science to finance and everyday life — all free, no account needed.