cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A105801 Fibonacci-Collatz sequence: a(1)=1, a(2)=2; for n > 2, let fib = a(n-1) + a(n-2); if fib is odd then a(n) = 3*fib + 1 else a(n) = fib/2.

This page as a plain text file.
%I A105801 #36 Sep 09 2017 20:15:32
%S A105801 1,2,10,6,8,7,46,160,103,790,2680,1735,13246,44944,29095,222118,
%T A105801 753640,487879,3724558,12637312,8180935,62454742,211907032,137180887,
%U A105801 1047263758,3553333936,2300298847,17560898350,59583591592,38572244971
%N A105801 Fibonacci-Collatz sequence: a(1)=1, a(2)=2; for n > 2, let fib = a(n-1) + a(n-2); if fib is odd then a(n) = 3*fib + 1 else a(n) = fib/2.
%C A105801 Taking a(1)=1, a(2)=1 leads to the all-ones sequence 1,1,1,1,1,1,... (A000012); similarly a(1)=a(2)=b gives "all b's" sequence b,b,b,b,b,....
%C A105801 Apparently, for n > 2, the sequence is periodic modulo 2 with period 3. However, this regularity is disrupted when starting at a(34)=4937737952464 a run of 6 even terms appears.
%C A105801 It is easy to prove that all the terms a(n) with n >= 10 are congruent to 7 mod 9.
%C A105801 Conjecture: for every k > 0 there is an index m such that all the a(n) with n > m have the same residue mod 3^k. - _Giovanni Resta_, Nov 17 2010
%H A105801 N. J. A. Sloane, <a href="/A105801/b105801.txt">Table of n, a(n) for n = 1..3000</a>
%p A105801 M:=3000: a:=1: b:=2: lprint(1,1): lprint(2,2): for n from 3 to M do c:=a+b: if (c mod 2) = 0 then d:=c/2 else d:=3*c+1: fi: lprint(n,d): a:=b: b:=d: od: # _N. J. A. Sloane_, Nov 20 2010
%t A105801 a[1]=1; a[2]=2; a[n_]:=a[n]=(fib=a[n-1]+a[n-2]; col=If[OddQ[fib],3*fib+1,fib/2]); Table[a[n],{n,30}]
%o A105801 (PARI) A105801(n)=if(n<3,if(n<2,1,2),f=A105801(n-1)+A105801(n-2); if(f%2,3*f+1,f/2))
%o A105801 (Haskell)
%o A105801 a105801 n = a105801_list !! (n-1)
%o A105801 a105801_list = 1 : 2 : fc 2 1 where
%o A105801    fc x x' = y : fc y x where y = a006370 (x + x')
%o A105801 -- _Reinhard Zumkeller_, Oct 09 2011
%Y A105801 Cf. A000012, A000045, A006370, A181663.
%Y A105801 Cf. A181717.
%K A105801 nonn
%O A105801 1,2
%A A105801 _Zak Seidov_, Sep 12 2006
%E A105801 Incorrect formula deleted by _Colin Barker_, Jul 29 2013