Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #53 Sep 08 2022 08:45:55
%S 0,1,-1,4,-7,19,-40,97,-217,508,-1159,2683,-6160,14209,-32689,75316,
%T -173383,399331,-919480,2117473,-4875913,11228332,-25856071,59541067,
%U -137109280,315732481,-727060321,1674257764,-3855438727,8878212019,-20444528200,47079164257,-108412748857
%N a(n) = 3*a(n-2) - a(n-1) for n > 1, a(0) = 0, a(1) = 1.
%C This is A006130 with minus signs on every other term. - _T. D. Noe_, Apr 23 2012
%H G. C. Greubel, <a href="/A182228/b182228.txt">Table of n, a(n) for n = 0..200</a>
%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (-1,3).
%F From _R. J. Mathar_, Apr 22 2013: (Start)
%F a(n) = -A140167(n).
%F G.f.: x/(1 + x - 3*x^2). (End)
%F G.f.: 1 - Q(0), where Q(k) = 1 + 3*x^2 - (k+2)*x + x*(k+1 - 3*x)/Q(k+1); (continued fraction). - _Sergei N. Gladkovskii_, Oct 06 2013
%F E.g.f.: (-1/sqrt(13))*(exp(-(1+sqrt(13))*x/2) - exp(-(1-sqrt(13))*x/2)). - _G. C. Greubel_, Aug 30 2015
%F a(n) = (-(-1)^n/sqrt(13))*(((1 + sqrt(13))/2)^n - ((1 - sqrt(13))/2)^n). - _Taras Goy_, Jul 17 2018
%t RecurrenceTable[{a[n]== - a[n-1] + 3*a[n-2], a[0]== 0, a[1]== 1}, a, {n,0,200}] (* _G. C. Greubel_, Aug 30 2015 *)
%t LinearRecurrence[{-1,3},{0,1},40] (* _Harvey P. Dale_, Oct 23 2016 *)
%o (Python)
%o prpr = 0
%o prev = 1
%o for i in range(2,55):
%o current = prpr*3-prev
%o print (current, end=',')
%o prpr = prev
%o prev = current
%o (Magma) [n le 2 select n-1 else -Self(n-1) + 3*Self(n-2): n in [1..40]]; // _Vincenzo Librandi_, Aug 31 2015
%Y Cf. A140167.
%K sign,easy
%O 0,4
%A _Alex Ratushnyak_, Apr 19 2012