OFFSET
2,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-5,5,1,-3,1).
FORMULA
From Wesley Ivan Hurt, Jul 10 2014: (Start)
a(n) = Sum_{i=1..n} i * (n-i) * (i-ceiling((i-1)/2)).
a(n) = (108 - 36n - n^2 + n^4 + (70n - 266) * ceiling((3 - n)/2) - (42n - 234) * ceiling((3 - n)/2)^2 + (8n - 88) * ceiling((3 - n)/2)^3 + 12 * ceiling((3 - n)/2)^4 - 4n * floor(n/2) - (12n - 12) * floor(n/2)^2 - (8n - 24) * floor(n/2)^3 + 12 * floor(n/2)^4) / 12. (End)
a(n) = (n*(1+3*(-1)^n-2*n+2*n^2+2*n^3))/48. - Colin Barker, Jul 10 2014
G.f.: -x^2*(2*x^2+x+1) / ((x-1)^5*(x+1)^2). - Colin Barker, Jul 10 2014
MAPLE
A206806:=n->add(i*(n-i)*(i-ceil((i-1)/2)), i=1..n): seq(A206806(n), n=2..50); # Wesley Ivan Hurt, Jul 10 2014
MATHEMATICA
s[k_] := Floor[k/2]*Ceiling[k/2]; t[1] = 0;
Table[s[k], {k, 1, 20}] (* A002620 *)
p[n_] := Sum[s[k], {k, 1, n}];
c[n_] := n*s[n] - p[n];
t[n_] := t[n - 1] + (n - 1) s[n] - p[n - 1]
Table[c[n], {n, 2, 50}] (* A049774 *)
f = Flatten[Table[t[n], {n, 2, 50}]] (* A206806 *)
Table[Sum[i (n - i) (i - Ceiling[(i - 1)/2]), {i, n}], {n, 2, 50}] (* Wesley Ivan Hurt, Jul 10 2014 *)
CoefficientList[Series[-(2 x^2 + x + 1)/((x - 1)^5 (x + 1)^2), {x, 0, 40}], x] (* Vincenzo Librandi, Jul 10 2014 *)
PROG
(Magma) [(108-36*n-n^2+n^4+(70*n-266)*Ceiling((3-n)/2)-(42*n-234)*Ceiling((3-n)/2)^2+(8*n-88)*Ceiling((3-n)/2)^3+12*Ceiling((3-n)/2)^4-4*n*Floor(n/2)-(12*n-12)*Floor(n/2)^2-(8*n-24)*Floor(n/2)^3+12*Floor(n/2)^4)/12: n in [2..50]]; // Wesley Ivan Hurt, Jul 10 2014
(PARI) vector(100, n, ((n+1)*(1+3*(-1)^(n+1)-2*(n+1)+2*(n+1)^2+2*(n+1)^3))/48) \\ Colin Barker, Jul 10 2014
(PARI) Vec(-x^2*(2*x^2+x+1)/((x-1)^5*(x+1)^2) + O(x^100)) \\ Colin Barker, Jul 10 2014
(Sage) [sum([sum([floor(k^2/4)-floor(j^2/4) for j in range(1, k)]) for k in range(2, n+1)]) for n in range(2, 44)] # Danny Rorabaugh, Apr 18 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Feb 15 2012
STATUS
approved