OFFSET
0,2
LINKS
R. H. Hardin, Table of n, a(n) for n = 0..500
Index entries for linear recurrences with constant coefficients, signature (2,-1,1)
FORMULA
a(n) = 2*a(n-1) - a(n-2) + a(n-3) for n > 3. - Andrew Howroyd, Feb 14 2018
G.f.: (1 + x^2 + x^3)/(1 - 2*x + x^2 - x^3). - R. J. Mathar, Dec 01 2011
a(n) = 2*A005251(n + 2) for n > 0. - Andrew Howroyd, Feb 14 2018
MAPLE
a:= n-> (<<0|1|0>, <0|0|1>, <1|-1|2>>^n. <<2, 2, 4>>)[1, 1]-0^n:
seq(a(n), n=0..40); # Alois P. Heinz, Feb 14 2018
MATHEMATICA
LinearRecurrence[{2, -1, 1}, {1, 2, 4, 8}, 50] (* G. C. Greubel, Sep 18 2017 *)
PROG
(PARI) Vec((1 + x^2 + x^3)/(1 - 2*x + x^2 - x^3) + O(x^40)) \\ G. C. Greubel, Sep 18 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
R. H. Hardin, Aug 14 2009
EXTENSIONS
a(0)-a(3) prepended by Andrew Howroyd, Feb 14 2018
STATUS
approved