A simple math problem even greatest mathematicians couldn't solve.
Inspiration taken from this video
The algorithm follows two rules.
- If the given number is even, divide the number by 2.
- If the given number is odd, multiply the number by 3 and add 1 to it. This goes on and on until it eventually reaches 1.
- Veritasium's video about The Simplest Math Problem No One Can Solve.
- Wikipedia's article on Collatz Conjecture.