OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (1,3,-3,-3,3,1,-1).
FORMULA
From G. C. Greubel, Jan 17 2022: (Start)
a(n) = ( (75 + 182*n + 63*n^2 + 4*n^3) - 3*(25 + 10*n + n^2)*(-1)^n )/48.
G.f.: x*(9 + 3*x - 8*x^2 - 2*x^3 + 2*x^4)/((1-x)^4 * (1+x)^3).
a(n) = (-60 - 18*n + (14 + 3*n)*f(n) + 3*(4+n)*f(n)^2 - 2*f(n)^3)/6, where f(n) = floor((n+5)/2). (End)
MATHEMATICA
Table[Sum[j*(n-j+5), {j, 3, Floor[(n+5)/2]}], {n, 50}] (* G. C. Greubel, Jan 17 2022 *)
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {9, 12, 31, 38, 70, 82, 130}, 60] (* Harvey P. Dale, Aug 23 2024 *)
PROG
(Sage) [( (75 +182*n +63*n^2 +4*n^3) - 3*(25 +10*n +n^2)*(-1)^n )/48 for n in (1..50)] # G. C. Greubel, Jan 17 2022
(Magma) [(&+[j*(n+5-j): j in [3..Floor((n+5)/2)]]) : n in [1..50]]; // G. C. Greubel, Jan 17 2022
(PARI) a(n)=((75+182*n+63*n^2+4*n^3)-3*(25+10*n+n^2)*(-1)^n)/48 \\ Charles R Greathouse IV, Oct 21 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved