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.
%I A097564 #31 Aug 30 2024 02:55:22 %S A097564 0,1,1,2,1,3,4,3,7,10,7,17,24,17,41,58,41,99,140,99,239,338,239,577, %T A097564 816,577,1393,1970,1393,3363,4756,3363,8119,11482,8119,19601,27720, %U A097564 19601,47321,66922,47321,114243,161564,114243,275807,390050,275807,665857 %N A097564 a(n) = (a(n-1) mod 2)*a(n-1) + a(n-2) with a(0)=0, a(1)=1. %C A097564 The sequences a(2), a(5), ... a(1+3*n) ... and a(4), a(7), ... a(4 + 3n) ... are both A001333 (numerators of continued fraction convergents to sqrt(2)). The sequence a(0), a(3), a(6), ... a(3+3*n) ... is twice A000129 (the Pell nos. or the denominators of continued fraction convergents to sqrt(2).), also is A052542 starting w/ offset 1. %H A097564 Colin Barker, <a href="/A097564/b097564.txt">Table of n, a(n) for n = 0..1000</a> %H A097564 D. Panario, M. Sahin, and Q. Wang, <a href="http://www.emis.de/journals/INTEGERS/papers/n78/n78.Abstract.html">A family of Fibonacci-like conditional sequences</a>, INTEGERS, Vol. 13, 2013, #A78. %H A097564 <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,2,0,0,1). %F A097564 From _Colin Barker_, Jun 01 2016: (Start) %F A097564 a(n) = 2*a(n-3) + a(n-6) for n>5. %F A097564 G.f.: x*(1+x+2*x^2-x^3+x^4) / (1-2*x^3-x^6). (End) %p A097564 m:=50; S:=series( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6), x, m+1): %p A097564 seq(coeff(S, x, j), j=0..m); # _G. C. Greubel_, Apr 20 2021 %t A097564 nxt[{a_,b_}]:={b,Mod[b,2]*b+a}; NestList[nxt,{0,1},50][[All,1]] (* or *) LinearRecurrence[{0,0,2,0,0,1},{0,1,1,2,1,3},50] (* _Harvey P. Dale_, Aug 15 2017 *) %o A097564 (PARI) concat(0, Vec(x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) + O(x^100))) \\ _Colin Barker_, Jun 02 2016 %o A097564 (Magma) [n le 2 select n-1 else (Self(n-1) mod 2)*Self(n-1)+Self(n-2): n in [1..50]]; // _Bruno Berselli_, Jun 02 2016 %o A097564 (Sage) %o A097564 def A097564_list(prec): %o A097564 P.<x> = PowerSeriesRing(ZZ, prec) %o A097564 return P( x*(1+x+2*x^2-x^3+x^4)/(1-2*x^3-x^6) ).list() %o A097564 A097564_list(50) # _G. C. Greubel_, Apr 20 2021 %K A097564 nonn,easy %O A097564 0,4 %A A097564 _Gerald McGarvey_, Aug 27 2004