Skip to main content
Number tools100% FreeInstant

Collatz Sequence Calculator: The 3n+1 Problem

This free calculator follows the Collatz (3n+1) sequence from any starting number. It lists every value, counts the steps to reach 1 and shows the highest number the sequence climbs to.

By Debmedia Technologies LLP · Kolkata, India · Updated

What Is It and When Do You Need It?

The Collatz problem is one of the simplest unsolved problems in mathematics. The rules fit in one line, yet no one can prove where every sequence ends.

Enter a starting number to see its journey.

How to Use This Tool

  1. Enter or paste your input in the box or boxes above.
  2. Choose the options, if there are any.
  3. Press the button to run the tool.
  4. Read the result and use the copy button where one is shown.

How the Calculation Works

The tool applies the rule n to n/2 for even n and n to 3n+1 for odd n, one step at a time, and records each value. It counts the steps until the value is 1 and tracks the largest value seen.

Worked Example

Start at 6: 6, 3, 10, 5, 16, 8, 4, 2, 1. That is 8 steps and a peak of 16. Start at 27: 111 steps and a peak of 9,232.

Common Uses

  • Maths puzzles and teaching.
  • Programming exercises.
  • Exploring number patterns.
  • Checking homework.

Tips and Common Mistakes

  • Try small numbers first.
  • Long sequences are shown in a copy box.
  • The sequence for 1 is just 1.
  • Check the first result against a case you already know, so you can trust the tool for the rest.
  • Nothing you type leaves your device. The work is done by your browser, so it also works with a slow connection once the page has loaded.

Next, you may need the triangular number calculator, perfect number checker, prime number checker, GCD and LCM calculator.

Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.

Frequently Asked Questions

Start with any positive whole number. If it is even, halve it. If it is odd, multiply by 3 and add 1. Repeat.
Every number tested so far does, but nobody has proved it for all numbers. That is the Collatz conjecture.
It takes 111 steps and rises to 9,232 before it falls to 1, which makes it a famous example.
The tool accepts numbers up to one trillion and stops after 100,000 steps.

Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.