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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A057165 Addition steps in Recaman's sequence A005132. 9
1, 2, 3, 5, 6, 7, 9, 11, 13, 15, 17, 18, 19, 21, 24, 26, 28, 30, 32, 33, 34, 36, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 66, 67, 69, 71, 73, 75, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 101, 102, 104, 106, 108, 112, 113, 114 (list; graph; refs; listen; history; internal format)
OFFSET

1,2

LINKS

Nick Hobson, Python program for this sequence

C. L. Mallows, Plot (jpeg) of first 10000 terms of A005132

C. L. Mallows, Plot (postscript) of first 10000 terms of A005132

Index entries for sequences related to Recaman's sequence

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

PROG

(Haskell)

import Data.Set (Set, singleton, notMember, insert)

a057165 n = a057165_list !! n

a057165_list = r (singleton 0) 1 0 where

   r :: Set Integer -> Integer -> Integer -> [Integer]

   r s n x = if x > n && (x - n) `notMember` s

                then r (insert (x-n) s) (n+1) (x-n)

                else n : r (insert (x+n) s) (n+1) (x+n)

-- Reinhard Zumkeller, Mar 17 2011

CROSSREFS

Cf. A005132, A057166, A057167.

Union of A187921 and A187922.

Sequence in context: A143664 A114148 A106843 * A023884 A135607 A026453

Adjacent sequences:  A057162 A057163 A057164 * A057166 A057167 A057168

KEYWORD

nonn

AUTHOR

N. J. A. Sloane (njas(AT)research.att.com), Sep 14 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
Recent Additions | More pages | Superseeker | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified February 13 08:12 EST 2012. Contains 205451 sequences.