Interactive mathematics

Collatz Explorer

Compare Collatz paths, see where they merge, and inspect any step.

The Collatz rulen / 2 if even3n + 1 if odd

Each path stops when it first reaches 1.

Choose a starting number
Compare a range of starting numbers

Enter the last starting number to explore a range; both bounds are included. Leave it blank for one path. Highlighted start is available when you enter a last starting number.

Expressions and limits

Enter a positive whole number or an expression, for example 2^10000 - 1. Commas can group thousands, as in 352,531,512. Use +, −, * or ×, ^ and parentheses; ^ means exponentiation. Highlighted start chooses the path shown in gold and may be outside the range. Start + 7 means the first starting number plus 7: the eighth start in a range. Inputs can have up to 1,000,000 decimal digits if your browser supports integers that large. A range can include at most 5,000 consecutive starts.

Try an example
The Collatz trajectory starting at 27The value rises and falls, peaks at 9,232 on step 77, and reaches 1 after 111 steps. Horizontal position shows the step; vertical position shows value on a logarithmic scale.
Your selection

From start: each path begins at step 0. Each step follows the selected rule.

Start 27 · 111 steps to 1

Selected path

Start 27

Path length
111 steps to 1
Highest value
9,232 · step 77
First step below start
Step 96
Value over the journey · logarithmic scale

Step 0 of 111

Value at this step27

Exact integer

Compare starting numbers

Comparisons

Pin this path, then explore another number to compare them. Open Compare a range to explore consecutive starts.

Starting number →Steps to 1 ↑

Pinned comparisons

Pin up to five starting numbers to compare their paths.

An open question

Does every start reach 1?

The Collatz conjecture asks whether every positive whole number eventually reaches 1. Exploring examples reveals surprising structure, but does not prove the conjecture.

Reading the views

Flow shows completed paths merging toward 1. The horizontal axis counts steps remaining; vertical placement separates branches. Trajectories plots value against step. Logarithmic height makes large peaks readable; each doubling takes the same vertical space. Choose At 1 to line up completed paths where they reach 1. Depth adds logarithmic value as height to the Flow map; branch spacing separates the paths in 3D.

Long paths are drawn with fewer points; zoom in far enough to see every step. Step controls and Copy exact value let you inspect exact integers. During playback, the value preview may be approximate. Fit comparisons expands the Trajectories chart to include pinned paths. Pause keeps computed progress; Continue resumes it. Stop ends the current computation while keeping available results. Very large runs may stop at a memory limit.

For odd numbers, the shortcut rule combines 3n + 1 and the following division by 2 into one step. It skips the intermediate value, so step counts and peaks may differ. Changing the rule recomputes the paths.