I have this rules for creating a list of numbers:
- $x/2$ if $x$ is even, repeat
- $3x+1$ if $x$ is odd, repeat
- 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