login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A309214 a(0)=0; thereafter a(n) = a(n-1)+n if a(n-1) even, otherwise a(n) = a(n-1)-n. 4
0, 1, -1, -4, 0, 5, -1, -8, 0, 9, -1, -12, 0, 13, -1, -16, 0, 17, -1, -20, 0, 21, -1, -24, 0, 25, -1, -28, 0, 29, -1, -32, 0, 33, -1, -36, 0, 37, -1, -40, 0, 41, -1, -44, 0, 45, -1, -48, 0, 49, -1, -52, 0, 53, -1, -56, 0, 57, -1, -60, 0, 61, -1, -64, 0, 65, -1, -68, 0, 69, -1, -72, 0, 73, -1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

A003816 and A309215 have the same terms except for signs.

LINKS

Colin Barker, Table of n, a(n) for n = 0..1000

Index entries for linear recurrences with constant coefficients, signature (1,-2,2,-1,1).

FORMULA

a(4t)=0, a(4t+1)=4t+1, a(4t+2)=-1, a(4t+3)=-(4t+4).

From Colin Barker, Aug 13 2019: (Start)

G.f.: x*(1 - 2*x - x^2) / ((1 - x)*(1 + x^2)^2).

a(n) = a(n-1) - 2*a(n-2) + 2*a(n-3) - a(n-4) + a(n-5) for n>4.

a(n) = (-2 + (1+i)*(-i)^n + (1-i)*i^n + 2*i*((-i)^n-i^n)*n) / 4 where i=sqrt(-1).

(End)

E.g.f.: (1/2)*((1+2*x)*cos(x)-cosh(x)+sin(x)-sinh(x)). - Stefano Spezia, Aug 13 2019 after Colin Barker

MAPLE

t:=0;

a:=[t]; M:=100;

for i from 1 to M do

if (t mod 2) = 0 then t:=t+i else t:=t-i; fi;

a:=[op(a), t]; od:

a;

PROG

(PARI) concat(0, Vec(x*(1 - 2*x - x^2) / ((1 - x)*(1 + x^2)^2) + O(x^80))) \\ Colin Barker, Aug 13 2019

CROSSREFS

Cf. A003816, A309529, A309215, A309216, A319217.

Sequence in context: A239122 A195495 A003816 * A309215 A309216 A083745

Adjacent sequences:  A309211 A309212 A309213 * A309215 A309216 A309217

KEYWORD

sign,easy

AUTHOR

N. J. A. Sloane, Aug 10 2019

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 30 17:12 EDT 2020. Contains 337440 sequences. (Running on oeis4.)