OFFSET
0,3
REFERENCES
N. J. A. Sloane and Allan Wilks, On sequences of Recaman type, paper in preparation, 2006.
LINKS
Ivan Neretin, Table of n, a(n) for n = 0..10000
Nick Hobson, Python program for this sequence
FORMULA
Conjecture: for n>100, 1/2 < a(n)/(n*log(n)) < 1.
The conjecture is false. In fact, a(n) = n^(3/2)/6 + O(n). - N. J. A. Sloane, Apr 29 2006
MATHEMATICA
Fold[Append[#1, If[MemberQ[#1, (a = #1[[-1]]) - (r = Floor@Sqrt@#2)], a + r, a - r]] &, {0, 1}, Range[2, 70]] (* Ivan Neretin, Apr 22 2018 *)
PROG
(PARI) lista(nn) = {va = vector(nn+1); last = 0; for (n=1, nn, new = last - sqrtint(n); if ((new <= 0) || vecsearch(vecsort(va, , 8), new), new = last + sqrtint(n)); va[n+1] = new; last = new; ); va; } \\ Michel Marcus, Apr 23 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Feb 02 2003
STATUS
approved