OFFSET
0,1
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).
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
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 *)
PROG
(PARI) Vec((2-3*x-x^2)/((1-x)*(1-2*x-x^2)) + O(x^50)) \\ Colin Barker, Mar 16 2016
(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
(Sage) [1 + lucas_number1(n+1, 2, -1) for n in (0..30)] # G. C. Greubel, Oct 18 2019
(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
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 05 2000
STATUS
approved