Logo

MonoCalc

/

Collatz Conjecture Calculator

Math
Positive whole number, up to 1,000,000,000,000,000.

Try:

Sequence starting from 27

111 steps to reach 1

Reached 1Peak 9,232 (341.9x of start)

Total stopping time

111

Peak value

9,232

at step 77

Odd steps (3n+1)

41

Even steps (n/2)

70

Hailstone chart (log scale)

Sequence table

StepValueParity
027odd
182even
241odd
3124even
462even
531odd
694even
747odd
8142even
971odd
10214even
11107odd
12322even
13161odd
14484even
15242even
16121odd
17364even
18182even
1991odd
20274even
21137odd
22412even
23206even
24103odd
25310even
26155odd
27466even
28233odd
29700even
30350even
31175odd
32526even
33263odd
34790even
35395odd
361186even
37593odd
381780even
39890even
40445odd
411336even
42668even
43334even
44167odd
45502even
46251odd
47754even
48377odd
491132even
50566even
51283odd
52850even
53425odd
541276even
55638even
56319odd
57958even
58479odd
591438even
60719odd
612158even
621079odd
633238even
641619odd
654858even
662429odd
677288even
683644even
691822even
70911odd
712734even
721367odd
734102even
742051odd
756154even
763077odd
779232even
784616even
792308even
801154even
81577odd
821732even
83866even
84433odd
851300even
86650even
87325odd
88976even
89488even
90244even
91122even
9261odd
93184even
9492even
9546even
9623odd
9770even
9835odd
99106even
10053odd
101160even
10280even
10340even
10420even
10510even
1065odd
10716even
1088even
1094even
1102even
1111odd

About This Tool

Collatz Conjecture Calculator – Trace the 3n+1 Sequence

The Collatz conjecture, also known as the 3n+1 problem or the hailstone sequence, is one of the most famous unsolved problems in number theory — despite being simple enough to explain to a child. Pick any positive whole number. If it is even, divide it by two; if it is odd, triple it and add one. Repeat the process on whatever number you get. The conjecture claims that no matter which starting number you pick, you will always eventually reach 1. This calculator automates that trace, so you can explore the pattern for any starting integer without tallying dozens of steps by hand.

How the Rule Is Applied

The core rule is a single conditional step repeated until the sequence bottoms out: n → n / 2 when n is even, and n → 3n + 1 when n is odd. Starting from 27, for example, the sequence climbs and falls through 111 steps before reaching 1, peaking at 9,232 — over 340 times the starting value — along the way. That erratic rise-and-fall pattern is why the trace is nicknamed a hailstone sequence: like a hailstone bouncing up and down inside a storm cloud before it finally falls to the ground.

Total Stopping Time and Peak Value

Two numbers summarize any Collatz trace. The total stopping time is simply how many steps it takes to first reach 1. The peak value is the largest number the sequence touches before it descends — often far larger than the starting number, since a run of consecutive odd steps can multiply the value by nearly three each time before an even step brings it back down. This calculator reports both figures instantly, along with the exact step at which the peak occurred and a breakdown of how many odd (3n+1) versus even (n/2) steps were applied.

Verified, but not proven
The conjecture has been checked by computer for every starting value up to roughly 2⁶⁸ without a single exception, yet no one has proven it holds for everypositive integer. It remains one of mathematics' best-known open problems.

Fast Mode and BigInt Precision

For very large starting numbers, generating and rendering the entire sequence can be unnecessary overhead. Switching off "show full sequence" puts the calculator into a fast stopping-time-only modethat returns just the step count and peak value without storing every intermediate term. Under the hood, every calculation uses JavaScript's BigInt type rather than ordinary numbers, because intermediate values from the 3n+1 step can exceed Number.MAX_SAFE_INTEGEReven for starting numbers well within this tool's 1015 limit — keeping every result mathematically exact instead of approximated.

Range Analysis and Record Holders

Beyond tracing a single number, the range/batch mode computes the stopping time and peak value for every integer across a chosen span — up to 10,000 numbers at once — and automatically flags whichever starting number took the longest to reach 1, and whichever climbed to the highest peak. This is a popular way to hunt for local "records," such as discovering that 27 is the longest-running starting number under 100. To keep a large batch responsive, the calculator memoizes results: since many Collatz sequences merge into a shared tail on the way down (every sequence that reaches 16 continues 16, 8, 4, 2, 1), computing one number's stopping time can reuse work already done for an earlier one.

Parity Patterns and Step-Through Viewing

Toggling the parity pattern display renders each step as an odd or even marker, giving a compact visual of the sequence's underlying binary-like structure. The step-through animation control lets you walk through a sequence one iteration at a time with play, pause, and skip controls — handy for teaching the rule or double-checking a manual calculation. Results can be copied, downloaded as a text summary, exported as CSV for spreadsheet analysis, or shared via a link that restores your exact inputs for someone else.

Practical Limits

Starting numbers are accepted up to 1015, and a configurable max-steps safety limit (10,000 by default, adjustable to 100,000) prevents the browser from freezing if an edge case runs unexpectedly long. Range analysis is capped at 10,000 starting numbers per batch to keep the results table responsive and legible.

Frequently Asked Questions

Is the Collatz Conjecture Calculator free?

Yes, Collatz Conjecture Calculator is totally free :)

Can I use the Collatz Conjecture Calculator offline?

Yes, you can install the webapp as PWA.

Is it safe to use Collatz Conjecture Calculator?

Yes, any data related to Collatz Conjecture Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

What is the Collatz conjecture?

The Collatz conjecture (also called the 3n+1 problem or hailstone sequence) claims that if you repeatedly apply the rule "halve an even number, triple an odd number and add 1," every positive starting integer eventually reaches 1. It has been verified for enormous ranges of numbers by computer but remains mathematically unproven.

How does this Collatz calculator work?

Enter a positive starting integer and the tool repeatedly applies the rule — n/2 when n is even, 3n+1 when n is odd — until the sequence reaches 1 or hits the safety step limit. It reports the full sequence, total stopping time (steps to reach 1), peak value, and the odd/even step counts, and can also analyze a whole range of starting numbers at once.

What do "stopping time" and "peak value" mean?

Total stopping time is the number of steps a sequence takes to first reach 1. Peak value is the highest number the sequence reaches along the way, which can be dramatically larger than the starting number — for example, starting from 27 the sequence climbs to a peak of 9,232 before descending to 1.

Why does the calculator use BigInt arithmetic?

Even modest starting numbers can briefly spike to values far larger than the input, and starting numbers up to 10^15 are supported. JavaScript's regular number type loses precision above about 9 quadrillion, so this tool uses BigInt throughout the core loop to keep every intermediate value exact.

How does range/batch mode find record holders?

Range mode computes the stopping time and peak value for every integer in the chosen span and highlights whichever number took the most steps to reach 1, and whichever reached the highest peak. Calculations are memoized, so numbers that merge into a previously seen sub-sequence reuse that earlier work instead of recomputing it.

Is there a limit on how large the range or sequence can be?

Yes. A single sequence trace is capped by the max-steps safety limit (10,000 by default, adjustable up to 100,000) so the browser never freezes on an unexpectedly long run, and range/batch mode is capped at 10,000 starting numbers per batch to keep the results table responsive.