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 (2,7,-8,-16).
FORMULA
G.f.: (1+2*x+3*x^2)/(1-x-4*x^2)^2.
From G. C. Greubel, Dec 12 2021: (Start)
a(n) = 2^(n-3)*( -6*F(n+1, 1/2) + Sum_{j=0..n} F(n-j+1, 1/2)*( 14*F(j+1, 1/2) + 5*F(j, 1/2) ), where F(n, x) are the Fibonacci polynomials.
a(n) = (2^(n-1)/17)*(n+1)*( 14*L(n+2, 1/2) + 5*L(n+1, 1/2) ), where L(n, x) are the Lucas polynomials.
a(n) = 2*a(n-1) + 7*a(n-2) - 8*a(n-3) - 16*a(n-4). (End)
MATHEMATICA
LinearRecurrence[{2, 7, -8, -16}, {1, 4, 18, 56}, 30] (* G. C. Greubel, Dec 12 2021 *)
PROG
(Magma) I:=[1, 4, 18, 56]; [n le 4 select I[n] else 2*Self(n-1) +7*Self(n-2) -8*Self(n-3) -16*Self(n-4): n in [1..31]]; // G. C. Greubel, Dec 12 2021
(Sage) [2^(n-1)*(n+1)*(14*lucas_number2(n+2, 1/2, -1) + 5*lucas_number2(n+1, 1/2, -1))/17 for n in (0..30)] # G. C. Greubel, Dec 12 2021
(PARI) a(n)=([0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1; -16, -8, 7, 2]^n*[1; 4; 18; 56])[1, 1] \\ Charles R Greathouse IV, Oct 21 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved