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

Table 1: Some results k<100)Table 2: Numbers matched by number of links
nS(n)nS(n)nS(n)
3535106719
5437156911
71139237165
91341697373
111043207511
13745127716
151247667924
17949178116
191451178370
216539858
231155718721
251657228921
277059229159
291361149313
316763689561
331965199775
s(k)ks(k)k
3-1419, 61
451537
531625, 77, 81
6211749, 51
7131899
8851933, 65, 67
917, 532043
1011, 352187, 89
117, 23, 69, 752257, 59
1215, 452339
139, 29, 932479

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