A227805 Sum of even numbers starting at 2, alternating signs.
2, 6, 0, 8, -2, 10, -4, 12, -6, 14, -8, 16, -10, 18, -12, 20, -14, 22, -16, 24, -18, 26, -20, 28, -22, 30, -24, 32, -26, 34, -28, 36, -30, 38, -32, 40, -34, 42, -36, 44, -38, 46, -40, 48, -42, 50, -44, 52, -46, 54, -48, 56, -50, 58, -52, 60, -54, 62, -56, 64
Offset: 1
Examples
Using the sequence 2+4-6+8-10+12-14-16 gives (2+4)=6, (6-6)=0, (0+8)=8, (8-10)=-2, (-2+12)=10, etc., giving the sequence 6,0,8,-2,10,-4,12,-6,14,-8.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (-1,1,1).
Crossrefs
Cf. A195084.
Programs
-
Mathematica
nn = 100; s = 2 Range[2, nn]*Table[(-1)^i, {i, 2, nn}]; s = Join[{2}, s]; Accumulate[s] (* T. D. Noe, Aug 13 2013 *)
Formula
a(n) = 2 * A195084(n). - Joerg Arndt, Aug 14 2013
G.f.: 2*x*(1+4*x+2*x^2)/((1-x)*(1+x)^2). - Joerg Arndt, Aug 14 2013
Comments