login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A022831 a(n) = c(1)p(1) + ... + c(n)p(n), where c(i) = 1 if a(i-1) >= p(i) and c(i) = -1 if a(i-1) < p(i), for i = 1,...,n (p(i) = primes). 3
2, 5, 10, 3, 14, 1, 18, 37, 14, 43, 12, 49, 8, 51, 4, 57, 116, 55, 122, 51, 124, 45, 128, 39, 136, 35, 138, 31, 140, 27, 154, 23, 160, 21, 170, 19, 176, 13, 180, 7, 186, 5, 196, 3, 200, 1, 212, 435, 208, 437, 204, 443, 202, 453, 196, 459, 190, 461, 184 (list; graph; refs; listen; history; text; internal format)
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

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Index entries for sequences related to Recamán's sequence

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

Cf. A064365.

Sequence in context: A218336 A059955 A099796 * A064365 A177356 A078322

Adjacent sequences:  A022828 A022829 A022830 * A022832 A022833 A022834

KEYWORD

nonn

AUTHOR

Clark Kimberling

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 23 12:43 EDT 2019. Contains 321430 sequences. (Running on oeis4.)