Hailstone sequence generator form
Example data table
These sample values illustrate how different starting integers can create very different peaks and stopping times.
| Start | Sequence preview | Steps to 1 | Peak value |
|---|---|---|---|
| 5 | 5 → 16 → 8 → 4 → 2 → 1 | 5 | 16 |
| 7 | 7 → 22 → 11 → 34 → 17 → 52 → ... → 1 | 16 | 52 |
| 11 | 11 → 34 → 17 → 52 → 26 → 13 → ... → 1 | 14 | 52 |
| 27 | 27 → 82 → 41 → 124 → 62 → 31 → ... → 1 | 111 | 9,232 |
Formula used
The hailstone sequence applies a simple rule repeatedly to a positive integer. The value rises sharply on odd terms and falls on even terms.
If n is even: nnext = n / 2
If n is odd: nnext = 3n + 1
Total stopping time is the number of steps needed to first reach the stop value, usually 1.
Peak value is the largest term produced during the generated path.
Parity balance compares how many listed terms are odd versus even.
How to use this calculator
- Enter a positive starting integer.
- Set the maximum iterations allowed for the run.
- Choose the stop value, normally 1.
- Set grouped terms per row for the review table.
- Select whether to include the starting term and charts.
- Click Generate sequence to place results above the form.
- Review metrics, compact sequence text, and the detailed step table.
- Use the CSV or PDF buttons to export the current output.
Frequently asked questions
1) What is a hailstone sequence?
It is the number path made by repeatedly halving even values and replacing odd values with 3n + 1. The terms often jump up before eventually dropping toward 1.
2) Why is it also called the Collatz sequence?
The process is the same famous Collatz iteration. The name hailstone highlights how values can rise and fall like hailstones moving through clouds before landing.
3) What does stopping time mean here?
Stopping time is the number of steps needed to first reach the chosen stop value. In standard use, that value is 1.
4) Why can a small starting number create a huge peak?
Odd steps multiply the current value by three and add one. Repeated odd transitions can create large temporary growth before later even steps bring the sequence down.
5) Does every positive integer reach 1?
Computations support that many tested values reach 1, but a general proof for all positive integers is still unknown. That unanswered question makes the sequence mathematically famous.
6) Why is there an iteration limit?
The limit protects the page from extremely long runs and helps avoid excessive server work. You can raise it when exploring difficult starting values.
7) What do odd and even percentages show?
They summarize the parity mix of the displayed terms. This helps you see whether the generated path spends more time climbing through odd steps or falling through even steps.
8) What is the best way to compare two starting values?
Run each value separately and compare steps, peak values, growth ratio, and the chart shape. Those outputs reveal how differently two nearby integers can behave.