%I #25 Sep 08 2022 08:45:28
%S 1,1,0,1,-2,6,-17,49,-141,406,-1169,3366,-9692,27907,-80355,231373,
%T -666212,1918281,-5523470,15904198,-45794313,131859469,-379674209,
%U 1093228314,-3147825473,9063802210,-26098178316,75146709475,-216376326215,623030800329,-1793945691512,5165460748321
%N a(n) = -3*a(n-1) + a(n-3) for n>2, with a(0)=1, a(1)=1, a(2)=0.
%H G. C. Greubel, <a href="/A122099/b122099.txt">Table of n, a(n) for n = 0..1000</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (-3,0,1).
%F G.f.: (1+4*x+3*x^2)/(1+3*x-x^3).
%F a(n) = (-1)^n*A122100(n). - _R. J. Mathar_, Sep 27 2014
%p seq(coeff(series((1+4*x+3*x^2)/(1+3*x-x^3), x, n+1), x, n), n = 0..40); # _G. C. Greubel_, Oct 02 2019
%t Transpose[NestList[{#[[2]],Last[#],First[#]-3Last[#]}&, {1,1,0},35]][[1]] (* _Harvey P. Dale_, Mar 13 2011 *)
%t LinearRecurrence[{-3,0,1}, {1,1,0}, 40] (* _G. C. Greubel_, Oct 02 2019 *)
%o (PARI) Vec((1+4*x+3*x^2)/(1+3*x-x^3)+O(x^40)) \\ _Charles R Greathouse IV_, Jan 17 2012
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1+4*x+3*x^2)/(1+3*x-x^3) )); // _G. C. Greubel_, Oct 02 2019
%o (Sage)
%o def A122099_list(prec):
%o P.<x> = PowerSeriesRing(ZZ, prec)
%o return P((1+4*x+3*x^2)/(1+3*x-x^3)).list()
%o A122099_list(40) # _G. C. Greubel_, Oct 02 2019
%o (GAP) a:=[1,1,0];; for n in [4..40] do a[n]:=-3*a[n-1]+a[n-3]; od; a; # _G. C. Greubel_, Oct 02 2019
%Y Cf. A122100.
%K sign,easy,less
%O 0,5
%A _Philippe Deléham_, Oct 18 2006