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 A161204 #24 Sep 08 2022 08:45:45 %S A161204 2,-1,-1,1,3,1,3,9,19,33,67,137,275,545,1091,2185,4371,8737,17475, %T A161204 34953,69907,139809,279619,559241,1118483,2236961,4473923,8947849, %U A161204 17895699,35791393,71582787,143165577,286331155,572662305,1145324611,2290649225,4581298451,9162596897 %N A161204 a(0)=2. a(n+1) = 2*a(n) + period 4: repeat -5,1,3,1. %H A161204 Vincenzo Librandi, <a href="/A161204/b161204.txt">Table of n, a(n) for n = 0..1000</a> %H A161204 <a href="/index/Rec">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,1,2). %F A161204 First differences of A180343(n). %F A161204 G.f.: ( -2 + 3*x - x^3 + 2*x^2 ) / ( (2*x-1)*(1+x)*(1+x^2) ). - _R. J. Mathar_, Jan 26 2011 %F A161204 a(n) = 4*(-1)^floor((n+1)/2)*A000034(n+1)/5 + 2^n/15 + (-1)^n/3. - _R. J. Mathar_, Jan 26 2011 %F A161204 a(n) = a(n-4) + 2^(n-4). %F A161204 a(n) = a(n-2) + (-3,2,4,0,0,8,16,24,=sixth differences of A007910(n-1) = 0,0,1,2,3,6,13 or fifth differences of A007909(n); also -3,2,4,8*A007910(n-1)). %F A161204 a(n) = a(n-1) + a(n-2) + a(n-3) + 2*a(n-4). - _Vincenzo Librandi_, Jun 17 2012 %p A161204 A000034 := proc(n) if type(n,'even') then 1 ; else 2 ; end if; end proc: %p A161204 A161204 := proc(n) 4*(-1)^floor((n+1)/2)*A000034(n+1)/5+2^n/15+(-1)^n/3 ; end proc: # _R. J. Mathar_, Jan 26 2011 %t A161204 CoefficientList[Series[(-2+3*x-x^3+2*x^2)/((2*x-1)*(1+x)*(1+x^2)),{x,0,40}],x] (* _Vincenzo Librandi_, Jun 17 2012 *) %t A161204 LinearRecurrence[{1,1,1,2},{2,-1,-1,1},40] (* _Harvey P. Dale_, Dec 01 2019 *) %o A161204 (Magma) I:=[2, -1, -1, 1]; [n le 4 select I[n] else Self(n-1)+Self(n-2)+Self(n-3)+2*Self(n-4): n in [1..40]]; // _Vincenzo Librandi_, Jun 17 2012 %K A161204 sign,easy %O A161204 0,1 %A A161204 _Paul Curtz_, Jan 20 2011