OFFSET
1,2
COMMENTS
The terms display a 3-quasiperiodic pattern (1, 2m, 1-2m), m = 1, 2, 3, ...
Conjecture from Barker confirmed by recurrence formula. - Ray Chandler, Jul 31 2025
LINKS
Eric Angelini, Re: Add or subtract my cumulative sum of terms, SeqFan list, Feb 24 2020.
Index entries for linear recurrences with constant coefficients, signature (-1,-1,1,1,1).
FORMULA
a(3k-2) = 1, a(3k-1) = 2k, a(3k) = 1 - 2k, for all k >= 1.
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
KEYWORD
sign
AUTHOR
Eric Angelini and M. F. Hasler, Feb 24 2020
STATUS
approved
