[seqfan] Re: Add or subtract my cumulative sum of terms

M. F. Hasler oeis at hasler.fr
Tue Feb 25 18:16:28 CET 2020


On Mon, Feb 24, 2020 at 5:21 PM Éric Angelini wrote:

> > start T with a(1) = 1 and now:
> > if a(n) is odd, add to a(n) the cumultive sum Q of the terms of T;
> > if a(n) is even, subtract Q from a(n) to get a(n+1);
>
> op  +  -   +  +  -   +  +   -   +  +  -    +  +   -   +   +   -    +
> T = 1, 2, -1, 1, 4, -3, 1,  6, -5, 1,  8, -7, 1, 10, -9,  1, 12, -11, ...
> Q = 1  3   2  3  7   4  5  11   6  7  15   8  9  19  10  11  23   12
>

I like this very much!
Partial sums = absolute differences
= group positive integers by pairs, insert the sum in the middle of each
pair.
Simple but not in OEIS yet.
Proposed as https://oeis.org/draft/A332057 ;
the "main" sequence is https://oeis.org/A332056
-- 
Maximilian



More information about the SeqFan mailing list