Now I'm curious, is it guaranteed to terminate? Is there a name for this problem?
It needs to land on a power of 2 at some point.
It needs to land on a power of 2 at some point.
No one knows.
> Is there a name for this problem?
The statement that it always terminates is the Collatz Conjecture. It's the first problem in the posted article.
It's a clever way to re-state the problem to look more computer-science-y.
There are heuristic to show that the algorithm should terminate but there are numbers for which it takes an arbitrarily long time for convergence. Furthermore, there are similar problems that have divergence or loops. What makes matters worse is that it's been proven that such problems are undecidable in general.