OFFSET
1,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..500
Index entries for linear recurrences with constant coefficients, signature (4,-5,1,2,-1).
FORMULA
Binomial transform of [1, 3, 3, 0, 1, -1, 2, -3, 5, -8, ...].
From Andrew Howroyd, Aug 28 2018: (Start)
a(n) = 4*a(n-1) - 5*a(n-2) + a(n-3) + 2*a(n-4) - a(n-5) for n > 5.
a(n) = n*(n-1) + Fibonacci(n+2) - 1.
G.f.: x*(1 - x^2 - 2*x^3)/((1 - x)^3*(1 - x - x^2)).
(End)
EXAMPLE
a(4) = 19 = sum of row 4 terms of triangle A132921: (4 + 4 + 5 + 6).
a(5) = 32 = (1, 4, 6, 4, 1) dot (1, 3, 3, 0, 1) = (1 + 12 + 18 + 0 + 1).
MATHEMATICA
LinearRecurrence[{4, -5, 1, 2, -1}, {1, 4, 10, 19, 32}, 50] (* or *)
a[n_]:=n*(n - 1) + Fibonacci[n + 2] - 1; Array[a, 50] (* Stefano Spezia, Sep 01 2018 *)
PROG
(PARI) a(n) = n*(n-1) + fibonacci(n+2) - 1; \\ Andrew Howroyd, Aug 28 2018
(PARI) Vec((1 - x^2 - 2*x^3)/((1 - x)^3*(1 - x - x^2)) + O(x^40)) \\ Andrew Howroyd, Aug 28 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Gary W. Adamson, Sep 05 2007
EXTENSIONS
Terms a(11) and beyond from Andrew Howroyd, Aug 28 2018
STATUS
approved