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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A079049 Recamán variation: a(1) = 1; for n > 1, a(n) = a(n-1)-prime(n) if that number is positive and not already in the sequence, otherwise a(n) = a(n-1)+prime(n). 0
1, 4, 9, 2, 13, 26, 43, 24, 47, 18, 49, 12, 53, 10, 57, 110, 51, 112, 45, 116, 189, 268, 185, 96, 193, 92, 195, 88, 197, 84, 211, 80, 217, 78, 227, 76, 233, 70, 237, 64, 243, 62, 253, 60, 257, 58, 269, 46, 273, 44, 277, 38, 279, 28, 285, 22, 291, 20, 297, 16, 299, 6, 313 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..63.

PROG

(PARI) an=vector(100); an[1]=1; a(n)=if(n<0, 0, an[n]); an[n]=if(abs(sign(a(n-1)-prime(n))-1)+setsearch(Set(vector(n-1, i, a(i))), a(n-1)-prime(n)), a(n-1)+prime(n), a(n-1)-prime(n))

CROSSREFS

Cf. A005132.

Sequence in context: A070437 A238324 A128204 * A114578 A135044 A236854

Adjacent sequences:  A079046 A079047 A079048 * A079050 A079051 A079052

KEYWORD

nonn

AUTHOR

Benoit Cloitre, Feb 02 2003

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 February 20 14:59 EST 2019. Contains 320327 sequences. (Running on oeis4.)