1,2

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

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

(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

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

nonn,easy

N. J. A. Sloane, Dec 16 2001

More terms from Sascha Kurz, Mar 24 2002

approved