login
A022833
a(0)=2; thereafter a(n) = a(n-1) + prime(n) if a(n-1) < prime(n), otherwise a(n) = a(n-1) - prime(n). Cf. A008348.
0
2, 0, 3, 8, 1, 12, 25, 8, 27, 4, 33, 2, 39, 80, 37, 84, 31, 90, 29, 96, 25, 98, 19, 102, 13, 110, 9, 112, 5, 114, 1, 128, 259, 122, 261, 112, 263, 106, 269, 102, 275, 96, 277, 86, 279, 82, 281, 70, 293, 66, 295, 62, 301, 60, 311, 54, 317, 48, 319, 42, 323, 40
OFFSET
0,1
COMMENTS
Old definition was "a(n) = c(1)p(2) + ... + c(n)p(n+1), where c(i) = 1 if a(i-1) <= p(i+1) and c(i) = -1 if a(i-1) > p(i+1) (p(i) = primes)."
CROSSREFS
Sequence in context: A127160 A334847 A131330 * A257236 A209259 A020826
KEYWORD
nonn
EXTENSIONS
Name corrected by Sean A. Irvine, May 22 2019
Definition and start of sequence rewritten by N. J. A. Sloane, Sep 04 2019
STATUS
approved