The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332056 a(1) = 1, then a(n+1) = a(n) - (-1)^a(n) Sum_{k=1..n} a(k): if a(n) is odd, add the partial sum, else subtract. 4
1, 2, -1, 1, 4, -3, 1, 6, -5, 1, 8, -7, 1, 10, -9, 1, 12, -11, 1, 14, -13, 1, 16, -15, 1, 18, -17, 1, 20, -19, 1, 22, -21, 1, 24, -23, 1, 26, -25, 1, 28, -27, 1, 30, -29, 1, 32, -31, 1, 34, -33, 1, 36, -35, 1, 38, -37, 1, 40, -39 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
The terms display a 3-quasiperiodic pattern (1, 2m, 1-2m), m = 1, 2, 3, ...
LINKS
Eric Angelini, Re: Add or subtract my cumulative sum of terms, SeqFan list, Feb 24 2020.
FORMULA
a(3k-2) = 1, a(3k-1) = 2k, a(3k) = 1 - 2k, for all k >= 1.
Conjectures from Colin Barker, Feb 25 2020: (Start)
G.f.: x*(1 + x)*(1 + 2*x + x^3) / ((1 - x)*(1 + x + x^2)^2).
a(n) = -a(n-1) - a(n-2) + a(n-3) + a(n-4) + a(n-5) for n>5.
(End)
EXAMPLE
a(1) = 1 is odd, so we add the partial sum (so far equal to a(1)) to get the next term, a(2) = 2.
Now a(2) = 2 is even, so we subtract the partial sum 1 + 2 = 3 to get a(3) = -1.
And so on.
PROG
(PARI) s=-a=1; vector(100, n, a-=(-1)^a*s+=a)
(PARI) apply( {A332056(n)=[1-n\3*2, 1, n\/3*2][n%3+1]}, [1..99])
CROSSREFS
See A332057 for the partial sums.
Sequence in context: A264831 A264728 A306790 * A074744 A341474 A339303
KEYWORD
sign
AUTHOR
Eric Angelini and M. F. Hasler, Feb 24 2020
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 21:34 EDT 2024. Contains 373102 sequences. (Running on oeis4.)