Testing Collatz Conjecture

Collatz conjecture states that take any natural number nn , if nn is even divide it by 22 to get n/2n/2 , if nn is odd multiply it by 33 and add 11 to get 3n+13n+1 . Repeat the process indefinitely, no matter what number you start with, you will always eventually reach 11

Proving or disproving this conjecture is still a open problem in mathematics, but anyways here's the problem :

From first 100100 natural numbers, find the number which takes most number of iterations to reach 11(Remember we have to stop as soon as we reach to 11 otherwise we will end in an indefinte cycle of 4214-2-1)

As an example for number 66 we have :

631051684216\rightarrow 3\rightarrow 10\rightarrow 5\rightarrow 16\rightarrow 8\rightarrow 4\rightarrow 2\rightarrow 1

Here it is clear that 88 iterations are involved


Problem Loading...

Note Loading...

Set Loading...