Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A079049
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A079049 Recaman 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
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; listen)
OFFSET

1,2

PROGRAM

(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: A021207 A070437 A128204 this_sequence A114578 A135044 A064505

Adjacent sequences: A079046 A079047 A079048 this_sequence A079050 A079051 A079052

KEYWORD

nonn

AUTHOR

Benoit Cloitre (benoit7848c(AT)orange.fr), Feb 02 2003

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research