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

 

Logo

Annual Appeal: Please make a donation to keep the OEIS running. In 2018 we replaced the server with a faster one, added 20000 new sequences, and reached 7000 citations (often saying "discovered thanks to the OEIS").
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A228474 This is a Recamán-like sequence (cf. A005132). Starting at n, a(n) is the number of steps required to reach zero. On the k-th step move a distance of k in the direction of zero. If the number landed on has been landed on before, move a distance of k away from zero instead. 9
0, 1, 4, 2, 24, 26, 3, 1725, 12, 14, 4, 26, 123, 125, 15, 5, 119, 781802, 20, 22, 132896, 6, 51, 29, 31, 1220793, 23, 25, 7, 429, 8869123, 532009, 532007, 532009, 532011, 26, 8, 94, 213355, 213353, 248, 33, 31, 33, 1000, 9, 144, 110, 112, 82, 84, 210, 60, 34 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

The n-th triangular number A000217(n) has a(A000217(n)) = n.

a(n) + 1 = length of row n in tables A248939 and A248973. - Reinhard Zumkeller, Oct 20 2014

LINKS

Jon E. Schoenfield, Table of n, a(n) for n = 0..10000

Gordon Hamilton, Wrecker Ball Sequences, Video, 2013

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

EXAMPLE

a(2) = 4 because 2 -> 1 -> -1 -> -4 -> 0.

PROG

(PARI) a(n)={my(M=Map(), k=0); while(n, k++; mapput(M, n, 1); my(t=if(n>0, -k, +k)); n+=if(mapisdefined(M, n+t), -t, t)); k} \\ Charles R Greathouse IV, Aug 18 2014, revised Andrew Howroyd, Feb 28 2018

(Haskell)

a228474 = subtract 1 . length . a248939_row  -- Reinhard Zumkeller, Oct 20 2014

CROSSREFS

Cf. A000217, A005132.

Cf. A248939, A248973.

Sequence in context: A030211 A134461 A298593 * A058167 A140331 A095896

Adjacent sequences:  A228471 A228472 A228473 * A228475 A228476 A228477

KEYWORD

walk,nonn

AUTHOR

Gordon Hamilton, Aug 23 2013

EXTENSIONS

More terms from Jon E. Schoenfield, Jan 10 2014

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 18 20:06 EST 2018. Contains 318245 sequences. (Running on oeis4.)