How this calculation works
Trace the Collatz iteration and count steps to 1.
Even n→n/2, odd n→3n+1A worked example
13 goes to 40, 20, 10, 5, 16, 8, 4, 2 and 1.
Good to know
The search stops at 10,000 steps.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Trace the odd and even steps
Start at 13. It is odd, so 3 × 13 + 1 gives 40. Three divisions by two then take you through 20, 10 and 5. At 5 the odd rule gives 16, and four more divisions lead through 8, 4 and 2 to 1. The table starts at row zero, so nine transformations produce ten rows.
The Integer quotient and remainder calculator can check parity by dividing the current value by two. A remainder of zero selects the even rule.
The peak is 40, reached at the first step. Try starting at 26 next. Its first division gives 13, so it follows exactly the same path from there, takes ten steps in total and reaches the same peak.
What a completed run establishes
This calculator uses total stopping time, the number of transformations needed to reach 1. Some treatments use stopping time for the first step at which the sequence drops below the starting value. Starting at 13 gives 3 under that convention because 10 is the first smaller value.
A completed run establishes the result for that starting value. Running many examples does not prove that every positive integer reaches 1.
A few questions, answered
What happens after the display limit?
The table shows the start and up to 250 transformations. The step count and peak still use the full run, up to the 10,000-step calculation limit.
What happens if I start at 1?
The total stopping time is zero because the starting value already meets the stopping condition. The peak is 1.