OFFSET
1,1
COMMENTS
a(n) <= 2*prime(n). Conjecture: every number occurs in the sequence at most finitely many times. - Thomas Ordowski, Dec 03 2016
LINKS
EXAMPLE
a(1)=2, a(2)=2+3=5, a(3)=5+5=10, a(4)=10-7=3, a(5)=3+11=14, a(6)=14-13=1, ...
PROG
(Haskell)
a022831 n = a022831_list !! n
a022831_list = 2 : f 2 (tail a000040_list) where
f x (p:ps) | x' > 0 = x' : f x' ps
| otherwise = xp : f xp ps where x' = x - p; xp = x + p
-- Reinhard Zumkeller, Apr 26 2012
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Name corrected by Sean A. Irvine, May 22 2019
STATUS
approved