# Take any number...

1. Take any number
2. if it is even, halve it;
3. if it is odd, multiply it by 3 and add 1 and then halve it.
4. repeat these operations until you reach the number 1.

For example, starting with the number 5:
5 is odd; 5 x 3 = 15; add 1 : 16
16 ÷ 2 = 8 (step 1)
8 is even; halve it : 4 (step 2)
4 is even; halve it : 2 (step 3)
2 is even; halve it: 1, and stop. (step 4)

Taking it for granted that we will always reach the number 1 in the end, is there a connection between the number of steps required to reach the number 1 and the number we started with?

Here, if S(n) stands for the number of steps when we start with n, S(5) = 4.

So far all I've come up with is a pattern for the powers of two : S(2n) = n
e.g. 16 = 24, so S(16)=4.
We can ignore the even numbers, by the way, as s(k x 2n) = s(k) + n

n S(n) n S(n) n S(n) 3 5 35 10 67 19 5 4 37 15 69 11 7 11 39 23 71 65 9 13 41 69 73 73 11 10 43 20 75 11 13 7 45 12 77 16 15 12 47 66 79 24 17 9 49 17 81 16 19 14 51 17 83 70 21 6 53 9 85 8 23 11 55 71 87 21 25 16 57 22 89 21 27 70 59 22 91 59 29 13 61 14 93 13 31 67 63 68 95 61 33 19 65 19 97 75
s(k) k s(k) k 3 - 14 19, 61 4 5 15 37 5 3 16 25, 77, 81 6 21 17 49, 51 7 13 18 99 8 85 19 33, 65, 67 9 17, 53 20 43 10 11, 35 21 87, 89 11 7, 23, 69, 75 22 57, 59 12 15, 45 23 39 13 9, 29, 93 24 79

That's as far as I've got to date.