OFFSET
0,2
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..2000 (first 500 terms from R. H. Hardin)
Index entries for linear recurrences with constant coefficients, signature (2,-1,2,-3,1).
FORMULA
G.f.: -(x^7-2*x^6+x^2+1)/((x-1)*(x^4-2*x^3-x+1)). - R. J. Mathar, Jan 19 2011
MATHEMATICA
LinearRecurrence[{2, -1, 2, -3, 1}, {1, 2, 4, 8, 13, 21, 33, 52}, 40] (* Harvey P. Dale, Aug 19 2022 *)
PROG
(PARI) a(n)=if(n>2, ([0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1; 1, -3, 2, -1, 2]^(n-3)*[8; 13; 21; 33; 52])[1, 1], [1, 2, 4][n+1]) \\ Charles R Greathouse IV, May 28 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Aug 14 2009
EXTENSIONS
Edited by Alois P. Heinz, Oct 12 2017
STATUS
approved
