OFFSET
1,7
COMMENTS
A pair of even numbers that appear side by side in Collatz trajectory of n is considered a chain of length 2 and likewise for chains of greater length.
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
EXAMPLE
For n=3, Collatz trajectory of 3 is 3,10,5,16,8,4,2,1, hence the only chain is 16,8,4,2 and so a(3)=1; again for 12: 12,6,3,10,5,16,8,4,2,1 and as such there are two chains 12,6 and 16,8,4,2 so a(12)=2
MATHEMATICA
Collatz[n_] := NestWhileList[If[EvenQ[#], #/2, 3 # + 1] &, n, # > 1 &]; Table[c = Collatz[n]; cnt = 0; evenCnt = 0; Do[If[OddQ[i], evenCnt = 0, evenCnt++; If[evenCnt == 2, cnt++]], {i, c}]; cnt, {n, 100}] (* T. D. Noe, Feb 28 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jayanta Basu, Feb 28 2013
STATUS
approved