Skip to content
All apps

The Collatz problem

About this app

Trace the halve-or-3n+1 rule in 2D and compare neighbouring starting values as 3D trajectories. Explore the still-unproved conjecture behind their behaviour.

The Collatz conjecture

Take a positive integer n. If it is even, halve it; if it is odd, compute 3n + 1. Continue with the result. The Collatz conjecture from 1937 states that every starting number eventually reaches 1 and then cycles through 4 → 2 → 1. Computers have checked this for huge ranges of numbers, but it has not been proven. The sequences are called hailstone sequences because they rise and fall unpredictably: neighbouring starting numbers often need completely different numbers of steps.

What the app shows

In the 3D view the flight paths for 1, 2, 3 and so on start one after another, rise and fall above a value ladder and land on a plane at the value 1. Record flights are labelled with their starting number and step count and collected in a record table together with their peak. The 2D view works out every step for a starting value of your choice, with the current value, an even/odd badge and the latest steps.

Try it yourself

Switch between 3D and 2D, toggle the scale between logarithmic and linear and set the speed. Enter 27 in 2D: it climbs to 9232 and takes 111 steps, while 26 lands after 10. In 3D you can compare the flights from different angles, for example from the side along the start row or from above.

Frequently asked questions

What does the Collatz conjecture say?
That the sequence “even: halve, odd: 3n + 1” reaches 1 for every positive integer starting value and then ends in the cycle 4 → 2 → 1. Lothar Collatz stated it in 1937; it has been neither proven nor disproven.
Why are Collatz sequences called hailstone sequences?
Because their values rise and fall several times, like hailstones in a cloud, before they finally come down. The starting number 27, for example, climbs to 9232 and needs 111 steps to reach 1.
Has the Collatz conjecture been proven?
No. It has been verified by computer for all starting values up to more than 2^68, and there are partial results, for example that almost all starting values reach arbitrarily small values. A complete proof is missing.
What does the Collatz app show?
In 3D the flight paths of many starting numbers one after another with a record table, and in 2D every step for a starting value of your own. You set the scale, the speed and the viewing angle yourself.

Subject: Computer science

More from Computer science

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps