Pick a positive integer . If it is odd, multiply it by three and then add one. Otherwise (if it is even), divide it by two. The positive integer obtained is the new , and this procedure is repeated.
It is believed that will eventually become (this is called the Collatz conjecture.) Computers have checked that any value of less than does, indeed, eventually become if this procedure is applied enough times.
You will be given the value of . Determine how many times this procedure must be applied before becomes .
The initial value of .
The number of operations we have to perform on before it becomes .
Any value of , initial or intermediate, will be less than .
will go through these steps: