

A228474


This is a Recamánlike sequence (cf. A005132). Starting at n, a(n) is the number of steps required to reach zero. On the kth 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 nth triangular number T_n has a(T_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(v=List([n]), k, t, t2, steps); while(n, steps++; k++; if(n>0, t=nk; t2=n+k, t=n+k; t2=nk); for(i=1, #v, if(v[i]==t, listput(v, n=t2); next(2))); listput(v, n=t)); steps \\ Charles R Greathouse IV, Aug 18 2014
(Haskell)
a228474 = subtract 1 . length . a248939_row  Reinhard Zumkeller, Oct 20 2014


CROSSREFS

Cf. A005132.
Cf. A248939, A248973.
Sequence in context: A241437 A030211 A134461 * 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



