A052937 Expansion of (2-3*x-x^2)/((1-x)*(1-2*x-x^2)).
2, 3, 6, 13, 30, 71, 170, 409, 986, 2379, 5742, 13861, 33462, 80783, 195026, 470833, 1136690, 2744211, 6625110, 15994429, 38613966, 93222359, 225058682, 543339721, 1311738122, 3166815963, 7645370046, 18457556053, 44560482150, 107578520351, 259717522850
Offset: 0
Links
- Colin Barker, Table of n, a(n) for n = 0..1000
- INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 928
- Index entries for linear recurrences with constant coefficients, signature (3,-1,-1).
Programs
-
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
-
Magma
R
:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (2-3*x-x^2)/((1-x)*(1-2*x-x^2)) )); // G. C. Greubel, Oct 18 2019 -
Maple
spec:= [S,{S=Union(Sequence(Z),Sequence(Union(Z,Z,Prod(Z,Z))))},unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20); 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
-
Mathematica
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 *) 1+Fibonacci[Range[31],2] (* G. C. Greubel, Oct 18 2019 *)
-
PARI
Vec((2-3*x-x^2)/((1-x)*(1-2*x-x^2)) + O(x^50)) \\ Colin Barker, Mar 16 2016
-
Sage
[1 + lucas_number1(n+1, 2, -1) for n in (0..30)] # G. C. Greubel, Oct 18 2019
Formula
G.f.: (2-3*x-x^2)/((1-x)*(1-2*x-x^2)).
a(n) = 2*a(n-1) + a(n-2) - 2, with a(0)=2, a(1)=3, a(2)=6.
a(n) = 1 + Sum_{alpha=RootOf(-1+2*z+z^2)} (1 + alpha)*alpha^(-1-n)/4.
a(n) = (1 + (-(1-sqrt(2))^(1+n) + (1+sqrt(2))^(1+n))/(2*sqrt(2))). - Colin Barker, Mar 16 2016
Extensions
More terms from James Sellers, Jun 05 2000