OFFSET
1,3
LINKS
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).
G.f.: (-1 - x^2 + 2 x^3 - 2 x^4)/((-1 + x)^3 (1 + x)^2).
MATHEMATICA
c[1] = 1; c[2] = 1;
c[n_] := If[OddQ[n], c[n - 2] + n, c[n - 1] - n + 2]
Table[c[n], {n, 1, 120}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 24 2023
STATUS
approved