Find out the length of a recurrence

55 Views Asked by At

I have this rules for creating a list of numbers:

  1. $x/2$ if $x$ is even, repeat
  2. $3x+1$ if $x$ is odd, repeat
  3. if $x=1$, stop

so for example, starting from 15, the list will be: 15, 46, 23, 70, 45, 136, 68, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1.

So, for a starting x = 15, the length of the list will be 21. How to find out the length for an arbitrary x?

Of course i'm looking for the most general approach, ie if i change one of the rule or if i add one rule more

1

There are 1 best solutions below

0
On BEST ANSWER

The Collatz conjecture has been unsolved for a long time, and that is the best anyone can say about this posted question.