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 A181716 #37 Jun 19 2024 02:05:12 %S A181716 0,1,2,2,5,6,12,17,30,46,77,122,200,321,522,842,1365,2206,3572,5777, %T A181716 9350,15126,24477,39602,64080,103681,167762,271442,439205,710646, %U A181716 1149852,1860497,3010350,4870846,7881197,12752042,20633240,33385281,54018522,87403802 %N A181716 a(n) = a(n-1) + a(n-2) + (-1)^n, with a(0)=0 and a(1)=1. %C A181716 Aside from the first term, duplicate of A098600. %H A181716 Vincenzo Librandi, <a href="/A181716/b181716.txt">Table of n, a(n) for n = 0..1000</a> %H A181716 Aleksandar Petojević, Marjana Gorjanac Ranitović, Dragan Rastovac, and Milinko Mandić, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL27/Petojevic/peto5.html">The Golden Ratio, Factorials, and the Lambert W Function</a>, Journal of Integer Sequences, Vol. 27 (2024), Article 24.5.7. See p. 4. %H A181716 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,2,1). %F A181716 a(n) = a(n-1) + a(n-2) + (-1)^n. %F A181716 a(n) = 2*a(n-2) + a(n-3). %F A181716 a(n) - A000045(n) = A008346(n-2). %F A181716 G.f.: x*(1+2*x)/(1-2*x^2-x^3). - _Colin Barker_, Jan 09 2012 %F A181716 a(n) = A000032(n-1) + (-1)^n. - _G. C. Greubel_, Mar 25 2024 %F A181716 E.g.f.: exp(x/2)*(sqrt(5)*sinh(sqrt(5)*x/2) - cosh(sqrt(5)*x/2)) + exp(-x). - _Stefano Spezia_, Jun 18 2024 %t A181716 a[0]= 0; a[1]= 1; a[n_]:= a[n]= a[n-1] +a[n-2] +(-1)^n; Array[a,38,0] %t A181716 LinearRecurrence[{0,2,1},{0,1,2},40] (* _Vincenzo Librandi_, Jan 09 2012 *) %o A181716 (Magma) I:=[0, 1, 2]; [n le 3 select I[n] else 2*Self(n-2)+Self(n-3): n in [1..40]]; // _Vincenzo Librandi_, Jan 09 2012 %o A181716 (Magma) [Lucas(n-1)+(-1)^n: n in [0..40]]; // _G. C. Greubel_, Mar 25 2024 %o A181716 (SageMath) [lucas_number2(n-1,1,-1)+(-1)^n for n in range(41)] # _G. C. Greubel_, Mar 25 2024 %Y A181716 Cf. A000032, A000045, A008346, A119282. %Y A181716 First differences of A014217. %K A181716 easy,nonn %O A181716 0,3 %A A181716 _Robert G. Wilson v_, Nov 07 2010