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

 

Logo


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

%I

%S 0,1,4,2,24,26,3,1725,12,14,4,26,123,125,15,5,119,781802,20,22,132896,

%T 6,51,29,31,1220793,23,25,7,429,8869123,532009,532007,532009,532011,

%U 26,8,94,213355,213353,248,33,31,33,1000,9,144,110,112,82,84,210,60,34

%N 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.

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

%C a(n) + 1 = length of row n in tables A248939 and A248973. - _Reinhard Zumkeller_, Oct 20 2014

%H Jon E. Schoenfield, <a href="/A228474/b228474.txt">Table of n, a(n) for n = 0..10000</a>

%H Gordon Hamilton, <a href="http://www.youtube.com/watch?v=mQdNaofLqVc&amp;feature=youtu.be">Wrecker Ball Sequences</a>, Video, 2013

%H <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>

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

%o (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

%o (Haskell)

%o a228474 = subtract 1 . length . a248939_row -- _Reinhard Zumkeller_, Oct 20 2014

%Y Cf. A000217, A005132.

%Y Cf. A248939, A248973.

%K walk,nonn

%O 0,3

%A _Gordon Hamilton_, Aug 23 2013

%E More terms from _Jon E. Schoenfield_, Jan 10 2014

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 June 21 06:06 EDT 2018. Contains 305619 sequences. (Running on oeis4.)