Collatz Algorithm

The sequence of numbers involved is sometimes referred to as the hailstone sequence or hailstone numbers (because the values are normally subject to multiple descents and ascents like hailstones in a cloud), or as wondrous numbers. It is also known as the 3n + 1 problem, the 3n + 1 conjecture, the Ulam conjecture (after Stanisław Ulam), Kakutani's problem (after Shizuo Kakutani), the Thwaites conjecture (after Sir Bryan Thwaites), Hasse's algorithm (after Helmut Hasse), or the Syracuse problem.

Collatz source code, pseudocode and analysis