Collatz Conjecture Calculator

Explore the Collatz conjecture (3n+1 problem) for any starting number. See total steps, max value, stopping time, full sequence table, step chart visual, and preset examples.

Safety limit
For 'All Steps' mode
Total Steps to 1
111
Sequence reached 1 after 111 iterations
Maximum Value
9,232
Peak value reached during the sequence (ratio to start: 341.9ร—)
Stopping Time
96
Steps before the sequence first drops below the starting value (27)
Sequence Length
112
Total values in the sequence including the starting number and final 1
Even Steps
70
63.1% of all steps applied n/2
Odd Steps
41
36.9% of all steps applied 3n+1
Even:Odd Ratio
1.71
Ratio of even steps to odd steps (typically around 2:1 for most sequences)

Step Chart

Even (n/2)Odd (3n+1)

Sequence Table

StepValueOperationParity
027startodd
1823n+1even
241n/2odd
31243n+1even
462n/2even
531n/2odd
6943n+1even
747n/2odd
81423n+1even
971n/2odd
102143n+1even
11107n/2odd
123223n+1even
13161n/2odd
144843n+1even
15242n/2even
16121n/2odd
173643n+1even
18182n/2even
1991n/2odd
202743n+1even
21137n/2odd
224123n+1even
23206n/2even
24103n/2odd
253103n+1even
26155n/2odd
274663n+1even
28233n/2odd
297003n+1even
30350n/2even
31175n/2odd
325263n+1even
33263n/2odd
347903n+1even
35395n/2odd
361,1863n+1even
37593n/2odd
381,7803n+1even
39890n/2even
40445n/2odd
411,3363n+1even
42668n/2even
43334n/2even
44167n/2odd
455023n+1even
46251n/2odd
477543n+1even
48377n/2odd
491,1323n+1even
50566n/2even
51283n/2odd
528503n+1even
53425n/2odd
541,2763n+1even
55638n/2even
56319n/2odd
579583n+1even
58479n/2odd
591,4383n+1even
60719n/2odd
612,1583n+1even
621,079n/2odd
633,2383n+1even
641,619n/2odd
654,8583n+1even
662,429n/2odd
677,2883n+1even
683,644n/2even
691,822n/2even
70911n/2odd
712,7343n+1even
721,367n/2odd
734,1023n+1even
742,051n/2odd
756,1543n+1even
763,077n/2odd
779,2323n+1even
784,616n/2even
792,308n/2even
801,154n/2even
81577n/2odd
821,7323n+1even
83866n/2even
84433n/2odd
851,3003n+1even
86650n/2even
87325n/2odd
889763n+1even
89488n/2even
90244n/2even
91122n/2even
9261n/2odd
931843n+1even
9492n/2even
9546n/2even
9623n/2odd
97703n+1even
9835n/2odd
991063n+1even
10053n/2odd
1011603n+1even
10280n/2even
10340n/2even
10420n/2even
10510n/2even
1065n/2odd
107163n+1even
1088n/2even
1094n/2even
1102n/2even
1111n/2odd
Collatz Quick Reference
StartStepsMax ValueStopping Time
1010
2121
37166
4241
55163
68161
7165211
8381
919523
106161
151716011
207201
2523883
271119,23296
5024881
100251001
Planning notes, formulas, and examples

About the Collatz Conjecture Calculator

The **Collatz Conjecture Calculator** lets you explore one of the most famous unsolved problems in mathematics โ€” the 3n+1 conjecture, also known as the hailstone sequence or Syracuse problem. Enter any positive integer and watch the algorithm iterate: if the number is even, divide by 2; if odd, multiply by 3 and add 1. The conjecture states that every starting number eventually reaches 1, but no one has been able to prove it.

This calculator computes the full Collatz sequence for your chosen starting number, displays the total number of steps to reach 1, identifies the maximum value the sequence hits along the way, and calculates the stopping time (the first step where the value drops below the starting number). You can choose how many terms to display, toggle between showing all steps or just key milestones, and set a maximum iteration limit for safety.

A detailed sequence table shows every step with the value at that step, the operation applied (n/2 or 3n+1), and whether the value is even or odd. The step chart visual plots the sequence as a bar graph so you can see the dramatic rises and falls that give hailstone sequences their name. Preset buttons load famous examples like 27 (which reaches 9,232 before returning to 1 in 111 steps) and other interesting starting values.

Whether you are a student learning about iterative sequences, a math enthusiast exploring open problems, or a teacher looking for an engaging classroom demonstration, the page makes the Collatz conjecture tangible and interactive.

When This Page Helps

Collatz sequences can run for hundreds of steps and spike to enormous values โ€” manually iterating even a modest starting number like 27 (111 steps, peak 9,232) is impractical. This calculator computes the full sequence, charts the dramatic rises and falls, and highlights milestones so you can focus on the mathematical patterns. Number-theory students explore open conjectures interactively, teachers demonstrate how simple rules produce complex behaviour, and recreational mathematicians hunt for extreme stopping times.

How to Use the Inputs

  1. Enter a positive starting integer.
  2. Optionally set a maximum iteration limit.
  3. Select a display mode to show all steps or key milestones only.
  4. Click a preset to explore famous starting values.
  5. Review the output cards for total steps, max value, and stopping time.
  6. Scroll the sequence table to follow each step of the algorithm.
  7. Examine the bar chart visual to see the rise-and-fall pattern.
Formula used
If n is even: n โ†’ n/2. If n is odd: n โ†’ 3n + 1. Repeat until n = 1.

Example Calculation

Result: 6: 6 โ†’ 3 โ†’ 10 โ†’ 5 โ†’ 16 โ†’ 8 โ†’ 4 โ†’ 2 โ†’ 1

Starting with n = 6: 6 โ†’ 3 โ†’ 10 โ†’ 5 โ†’ 16 โ†’ 8 โ†’ 4 โ†’ 2 โ†’ 1. Total steps = 8, max value = 16, stopping time = 1 (step 2 drops to 3 < 6).

Tips & Best Practices

  • Check that all inputs use the same scale and assumptions before trusting the result.
  • Compare the answer with the worked example or a rough estimate to catch entry mistakes.

The 3n+1 Problem Explained

The rule is deceptively simple. Take any positive integer n. If it is even, divide by 2; if it is odd, compute 3n + 1. Repeat. The Collatz conjecture asserts that no matter what starting value you choose, the sequence will always eventually reach the cycle 4 โ†’ 2 โ†’ 1. Despite being easy to state, the problem has resisted proof since Lothar Collatz first posed it in 1937. Paul Erdล‘s famously commented that "mathematics may not be ready for such problems." The conjecture has been computationally verified for all integers up to roughly 2.95 ร— 10ยฒโฐ, yet no one knows whether a counterexample โ€” a starting value whose sequence diverges or enters a different cycle โ€” exists.

Surprising Behaviour and Record-Holders

What makes the Collatz conjecture captivating is the gap between the simplicity of the rule and the wildness of the resulting sequences. The number 27 is the classic example: its sequence climbs to a peak of 9,232 before finally descending to 1 after 111 steps. Larger starting values can produce even more extreme behaviour โ€” 77,031 takes 350 steps and peaks above 21 million. Powers of 2 reach 1 in exactly logโ‚‚(n) steps (trivially, since every step halves), while odd numbers tend to spike via the 3n + 1 rule before collapsing. There is no known formula to predict total stopping time from the starting value; the relationship appears chaotic.

Open Questions and Partial Results

Mathematicians have proven several partial results. In the late 2010s, Terrence Tao showed that "almost all" Collatz orbits attain values as small as desired โ€” loosely, the set of potential counterexamples has logarithmic density 0. However, this falls short of the full conjecture, which requires *every* orbit to reach 1. Other research focuses on the statistical distribution of stopping times and the density of even/odd steps. The 3n + 1 map can be extended to negative integers, where cycles other than 4 โ†’ 2 โ†’ 1 are known (e.g., โˆ’1 โ†’ โˆ’2 โ†’ โˆ’1). Exploring these related maps and generalisations (such as 5n + 1 or qx + 1) is an active area of recreational and professional mathematics alike.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • It states that for any positive integer, repeatedly applying the rule (n/2 if even, 3n+1 if odd) will eventually reach 1. It remains unproven.