%I #35 Sep 08 2022 08:44:59
%S 2,3,6,13,30,71,170,409,986,2379,5742,13861,33462,80783,195026,470833,
%T 1136690,2744211,6625110,15994429,38613966,93222359,225058682,
%U 543339721,1311738122,3166815963,7645370046,18457556053,44560482150,107578520351,259717522850
%N Expansion of (2-3*x-x^2)/((1-x)*(1-2*x-x^2)).
%H Colin Barker, <a href="/A052937/b052937.txt">Table of n, a(n) for n = 0..1000</a>
%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=928">Encyclopedia of Combinatorial Structures 928</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (3,-1,-1).
%F G.f.: (2-3*x-x^2)/((1-x)*(1-2*x-x^2)).
%F a(n) = 2*a(n-1) + a(n-2) - 2, with a(0)=2, a(1)=3, a(2)=6.
%F a(n) = 1 + Sum_{alpha=RootOf(-1+2*z+z^2)} (1 + alpha)*alpha^(-1-n)/4.
%F a(n) = A000129(n+1) + 1, where A000129 are the Pell Numbers. - _Graeme McRae_, Aug 03 2006
%F a(n) = (1 + (-(1-sqrt(2))^(1+n) + (1+sqrt(2))^(1+n))/(2*sqrt(2))). - _Colin Barker_, Mar 16 2016
%p spec:= [S,{S=Union(Sequence(Z),Sequence(Union(Z,Z,Prod(Z,Z))))},unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);
%p seq(coeff(series((2-3*x-x^2)/((1-x)*(1-2*x-x^2)), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Oct 18 2019
%t CoefficientList[Series[(2-3x-x^2)/((1-x)(1-2x-x^2)),{x,0,30}],x] (* or *) LinearRecurrence[{3,-1,-1},{2,3,6},40] (* _Harvey P. Dale_, May 27 2017 *)
%t 1+Fibonacci[Range[31],2] (* _G. C. Greubel_, Oct 18 2019 *)
%o (PARI) Vec((2-3*x-x^2)/((1-x)*(1-2*x-x^2)) + O(x^50)) \\ _Colin Barker_, Mar 16 2016
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (2-3*x-x^2)/((1-x)*(1-2*x-x^2)) )); // _G. C. Greubel_, Oct 18 2019
%o (Sage) [1 + lucas_number1(n+1, 2, -1) for n in (0..30)] # _G. C. Greubel_, Oct 18 2019
%o (GAP) a:=[2,3,6];; for n in [4..30] do a[n]:=3*a[n-1]-a[n-2]-a[n-3]; od; a; # _G. C. Greubel_, Oct 18 2019
%Y Cf. A000129, A001333.
%K easy,nonn
%O 0,1
%A encyclopedia(AT)pommard.inria.fr, Jan 25 2000
%E More terms from _James A. Sellers_, Jun 05 2000