login
The OEIS is supported by the many generous donors 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
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: A238324 A370952 A128204 * A366908 A114578 A135044
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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 02:41 EDT 2024. Contains 371906 sequences. (Running on oeis4.)