OFFSET
1,2
COMMENTS
This sequence has similarities with A019444: here we have partial alternating sums, there partial sums.
FORMULA
Apparently:
- a(3*k) = 3*k - 1,
- a(3*k+1) = 3*k + 1,
- a(3*k+2) = 6*k + 3.
EXAMPLE
The first terms, alongside the corresponding partial alternating sums, are:
n a(n) S_n
-- ---- ---
1 1 -1
2 3 2
3 2 0
4 4 4
5 9 -5
6 5 0
7 7 -7
8 15 8
9 8 0
10 10 10
11 21 -11
12 11 0
PROG
(PARI) s=t=0; for (n=1, 66, for (v=1, oo, if (!bittest(s, v) && (tt=t+v*(-1)^n)%n==0, print1 (v ", "); t=tt; s+=2^v; break)))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Sep 08 2019
STATUS
approved