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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A066199 a(1) = 1; for n > 1, a(n) = a(n-1)-(n+1) if this is positive and has not already appeared in the sequence, otherwise a(n) = a(n-1)+(n+1). 2
1, 4, 8, 3, 9, 2, 10, 19, 29, 18, 6, 19, 5, 20, 36, 53, 35, 16, 36, 15, 37, 14, 38, 13, 39, 12, 40, 11, 41, 72, 104, 71, 105, 70, 34, 71, 33, 72, 32, 73, 31, 74, 30, 75, 121, 168, 120, 169, 119, 68, 120, 67, 121, 66, 122, 65, 7, 66, 126, 187, 125, 62, 126, 61, 127, 60, 128 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Indranil Ghosh, Table of n, a(n) for n = 1..10000

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

PROG

(Python)

l=[0, 1]

for n in xrange(2, 101):

    x=l[n - 1] - (n + 1)

    if x>0 and not x in l: l+=[x, ]

    else: l+=[l[n - 1] + (n + 1)]

print l[1:] # Indranil Ghosh, Jun 02 2017

CROSSREFS

A variant of A005132. A row of the array in A066201.

Sequence in context: A273051 A021678 A180594 * A103647 A033197 A124002

Adjacent sequences:  A066196 A066197 A066198 * A066200 A066201 A066202

KEYWORD

nonn,easy

AUTHOR

N. J. A. Sloane, Dec 16 2001

EXTENSIONS

More terms from Sascha Kurz, Mar 24 2002

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 | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 20 08:16 EST 2018. Contains 317385 sequences. (Running on oeis4.)