OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (8,-20,16,-4).
FORMULA
G.f.: 3*x*(1-x)/(1-4*x+2*x^2)^2.
From Colin Barker, Aug 01 2019: (Start)
a(n) = 8*a(n-1) - 20*a(n-2) + 16*a(n-3) - 4*a(n-4) for n>3.
a(n) = 3*((-(2-sqrt(2))^n*(-1+sqrt(2)) + (1+sqrt(2))*(2+sqrt(2))^n)*n) / 8.
(End)
MATHEMATICA
LinearRecurrence[{8, -20, 16, -4}, {0, 3, 21, 108}, 30] (* G. C. Greubel, Jul 31 2019 *)
PROG
(PARI) my(x='x+O('x^30)); concat([0], Vec(3*x*(1-x)/(1-4*x+2*x^2)^2)) \\ G. C. Greubel, Jul 31 2019
(Magma) R<x>:=PowerSeriesRing(Integers(), 30); [0] cat Coefficients(R!( 3*x*(1-x)/(1-4*x+2*x^2)^2 )); // G. C. Greubel, Jul 31 2019
(Sage) (3*x*(1-x)/(1-4*x+2*x^2)^2).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Jul 31 2019
(GAP) a:=[0, 3, 21, 108];; for n in [5..30] do a[n]:=8*a[n-1]-20*a[n-2] +16*a[n-3]-4*a[n-4]; od; a; # G. C. Greubel, Jul 31 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Mar 18 2000
STATUS
approved