login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Number of Fibonacci numbers in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function.
0

%I #7 Aug 11 2016 05:50:23

%S 1,2,5,2,4,5,6,3,6,4,6,5,5,6,4,3,5,6,6,4,4,6,4,5,6,5,6,6,6,4,6,3,6,6,

%T 4,6,6,6,7,4,6,4,6,6,6,4,6,5,6,6,6,5,4,6,7,6,6,6,7,4,4,6,6,3,6,6,6,6,

%U 5,4,6,6,7,6,3,6,6,7,6,4,4,6,6,4,3,6,6,6,7,6,6,4,4,6,6,5,7,6,6,6

%N Number of Fibonacci numbers in {n, f(n), f(f(n)), ...., 1}, where f is the Collatz function.

%C Or number of Fibonacci numbers in the trajectory of n under the 3x+1 map (i.e. the number of Fibonacci numbers until the trajectory reaches 1).

%e The finite sequence n, f(n), f(f(n)), ...., 1 for n = 9 is: 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 which has six Fibonacci numbers {1, 2, 5, 8, 13, 34}. Hence a(9) = 6.

%t s = Fibonacci /@ Range@ 20; Table[Length@ Select[Union@ NestWhileList[If[EvenQ@ #, #/2, 3 # + 1] &, n, # != 1 &], MemberQ[s, #] &], {n, 120}] (* _Michael De Vlieger_, Aug 07 2016 *)

%o (PARI) print1(1, ", "); for(n=2, 100, s=n; t=1; while(s!=1, if(issquare(5*s^2+4) ||issquare(5*s^2-4), t++, t=t); if(s%2==0, s=s/2, s=(3*s+1)); if(s==1, print1(t, ", "); ); ))

%Y Cf. A006577.

%K nonn,easy

%O 1,2

%A _Michel Lagneau_, Aug 07 2016