(Translated by https://www.hiragana.jp/)
A227832 - OEIS
login
A227832
Sum of odd numbers starting with 1, alternating signs (beginning with plus)
0
1, 4, -1, 6, -3, 8, -5, 10, -7, 12, -9, 14, -11, 16, -13, 18, -15, 20, -17, 22, -19, 24, -21, 26, -23, 28, -25, 30, -27, 32, -29, 34, -31, 36, -33, 38, -35, 40, -37, 42, -39, 44, -41, 46, -43, 48, -45, 50, -47, 52, -49
OFFSET
1,2
COMMENTS
1st,3rd,5th (odd terms) increase by 2, 2nd,4th,6th,8th (even terms) decrease by 2 each time.
FORMULA
a(n) = -a(n-1) + a(n-2) + a(n-3). - Charles R Greathouse IV, Aug 02 2013
G.f.: x*(2*x^2 + 5*x + 1)/((1-x)*(1+x)^2). a(n) = n*(-1)^n + 2 = A038608(n) + 2. - Ralf Stephan, Aug 07 2013
EXAMPLE
(1+3)=4 (4-5)=-1 (-1+7)=6 (6-9)=-3 (-3+11)=8 (8-13)=-5 (-5+15)=10.
PROG
(PARI) a(n) = n*(-1)^n + 2; \\ Michel Marcus, Feb 08 2016
CROSSREFS
Cf. A065164 (absolute values).
Sequence in context: A200344 A328726 A127556 * A293432 A360327 A050307
KEYWORD
sign,easy
AUTHOR
D.Wilde, Aug 02 2013
STATUS
approved