OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
a(n) = (n * ceiling(n/2)) + ((15 + 25*n + 15*n^2 + 14*n^3 - 3*(((-1)^n))*(5 + n*(3 + n))) / 96).
G.f.: x*(2 + 2*x + 3*x^2 + x^3 - x^4)/((1 - x)^4*(1 + x)^3). - Stefano Spezia, Aug 19 2022
EXAMPLE
PROG
(Python)
def a(n): return (n * ((n + n % 2) // 2)) + (15 + 25*n + 15*(n**2) + 14*(n**3) - 3*(((-1)**n))*(5 + n*(3 + n))) // 96
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Torlach Rush, Aug 02 2022
STATUS
approved