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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A063733 A variant of Recamán's sequence: a(0)=1, a(n) = a(n-1)-(n-1) if positive and new, else a(n) = a(n-1)+(n-1). 10
1, 1, 2, 4, 7, 3, 8, 14, 21, 13, 22, 12, 23, 11, 24, 10, 25, 9, 26, 44, 63, 43, 64, 42, 19, 43, 18, 44, 17, 45, 16, 46, 15, 47, 80, 114, 79, 115, 78, 40, 79, 39, 80, 38, 81, 37, 82, 36, 83, 35, 84, 34, 85, 33, 86, 32, 87, 31, 88, 30, 89, 29, 90, 28, 91, 27 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

LINKS

R. Zumkeller, Table of n, a(n) for n = 0..10000

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

FORMULA

a(n+1) = A005132(n) - 1; A005132 is Recamán's sequence. - Franklin T. Adams-Watters, Mar 12 2010

PROG

(Haskell)

a063733 n = a063733_list !! n

a063733_list = 1 : f 0 [1] where

   f x ys@(y:_) | u > 0 && u `notElem` ys = u : f (x + 1) (u : ys)

                | otherwise               = v : f (x + 1) (v : ys)

                where u = y - x; v = x + y

-- Reinhard Zumkeller, Jul 02 2015

(Python)

l=[1]

for n in xrange(1, 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 # Indranil Ghosh, Jun 02 2017

CROSSREFS

See A005132, which is the main entry for this sequence. A063753 = 1 + A005132. A row of A066201. Also a row of A066202.

See also A078943.

Cf. A141126.

Sequence in context: A081145 A100707 A078943 * A187089 A141330 A239324

Adjacent sequences:  A063730 A063731 A063732 * A063734 A063735 A063736

KEYWORD

nonn,nice,easy,look

AUTHOR

N. J. A. Sloane, Sep 05 2001

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 July 25 06:40 EDT 2017. Contains 289779 sequences.