OFFSET
0,3
COMMENTS
LINKS
David Lovler, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
FORMULA
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5), n >= 5.
G.f.: x*(1 + 5*x + 3*x^2 + 3*x^3)/((1 - x)^3*(1 + x)^2).
E.g.f.: (x*(1 + 3*x)*cosh(x) + (1 + 3*x + 3*x^2)*sinh(x))/2. - Stefano Spezia, Jun 07 2022
MATHEMATICA
a[n_] := n^2 + 2 Floor[n/2]^2
Table[a[n], {n, 0, 90}] (* A354594 *)
LinearRecurrence[{1, 2, -2, -1, 1}, {0, 1, 6, 11, 24}, 60]
PROG
(PARI) a(n) = n^2 + 2*(n\2)^2;
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
David Lovler, Jun 01 2022
STATUS
approved