OFFSET
1,2
COMMENTS
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.: x*(-1 - x + x^3 - x^4)/((-1 + x)^3 (1 + x)^2).
a(n) = ((2n^2 + 2n + 5) - (2n - 3)*(-1)^n)/8. - Aaron J Grech, Aug 26 2024
E.g.f.: ((4 + 3*x + x^2)*cosh(x) + (1 + x + x^2)*sinh(x) - 4)/4. - Stefano Spezia, Aug 27 2024
MATHEMATICA
c[1] = 1; c[2] = 1;
c[n_] := If[OddQ[n], c[n - 2] + n, c[n - 1] - n + 2]
u = Table[c[n], {n, 1, 120}] (* A363268 *)
Union[u] (* this sequence *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 25 2023
EXTENSIONS
Definition corrected by N. J. A. Sloane, Jun 12 2023
STATUS
approved