4 ms·
> Now I'm curious, is it guaranteed to terminate? No one knows. > Is there a name for this problem? The statement that it always terminates is the Collatz Co
by ggchappell 11y ago
> Now I'm curious, is it guaranteed to terminate?
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.
- emiliobumachar 11y agoJust to clarify why, if the result is ever one (the loop's exit condition), then it would be about to get stuck repeating 1,4,2 forever if it didn't exit. If you can prove the loop does not exit (i.e., never reaches one) for some n, then you just proved that, for that n, it would never reach the 1,4,2 repetition pattern even without the stop condition. It's a clever way to re-state the problem to look more computer-science-y.