A110422 a(n) = sum( (-1)^(r+1)*(n-r)*r, r = 1..floor(n/2) ).
1, 2, -1, -2, 6, 8, -6, -8, 15, 18, -15, -18, 28, 32, -28, -32, 45, 50, -45, -50, 66, 72, -66, -72, 91, 98, -91, -98, 120, 128, -120, -128, 153, 162, -153, -162, 190, 200, -190, -200, 231, 242, -231, -242, 276, 288, -276, -288, 325, 338, -325, -338, 378, 392, -378, -392, 435, 450, -435, -450, 496, 512, -496, -512, 561
Offset: 2
Examples
a(8) = -6 because 7*1-6*2+5*3-4*4 = -6.
Links
- Index entries for linear recurrences with constant coefficients, signature (2,-4,6,-6,6,-4,2,-1).
Crossrefs
Cf. A023855.
Programs
-
Maple
a:=n->sum((-1)^(r+1)*(n-r)*r,r=1..floor(n/2)): seq(a(n),n=2..70); # Emeric Deutsch, Aug 08 2005
-
Mathematica
CoefficientList[Series[(2 x^3 - x^2 + 1)/((x - 1)^2 (x^2 + 1)^3), {x, 0, 70}], x] (* Vincenzo Librandi, Oct 30 2014 *) LinearRecurrence[{2,-4,6,-6,6,-4,2,-1},{1,2,-1,-2,6,8,-6,-8},70] (* Harvey P. Dale, Apr 04 2020 *)
-
PARI
Vec(x^2*(2*x^3-x^2+1)/((x-1)^2*(x^2+1)^3) + O(x^100)) \\ Colin Barker, Oct 30 2014
Formula
a(2n) = (1/2)n-(-1)^n*(1/2)n^2; a(2n-1) = (1/2)n-(1/4)+(-1)^n*(1/4)(2n^2-2n+1). - Emeric Deutsch, Aug 08 2005
a(n) = (-1)^((2*n-5+(-1)^n)/4)*(2*n^2+1-(-1)^n+4*n*(-1)^((2*n-5+(-1)^n)/4))/16. - Luce ETIENNE, Oct 30 2014
G.f.: x^2*(2*x^3-x^2+1) / ((x-1)^2*(x^2+1)^3). - Colin Barker, Oct 30 2014
Extensions
Corrected and extended by Emeric Deutsch, Aug 08 2005
Comments