%N Variation (3) on Recamán's sequence (A005132): set s (the step size) initially equal to 2; to get a(n), we first try to subtract s from a(n-1): a(n) = a(n-1)-s if positive and not already in the sequence, in which case we change s to s+1; if not, a(n) = a(n-1)+s+i, where i >= 0 is the smallest number such that a(n-1)+s+i has not already appeared and now we change s to s+i+1
%C Variation (4) (A064389) is the nicest of these variations.
%C I would also like to get the following sequences: number of steps before n appears (or 0 if n never appears), list of numbers that never appear, height of n (cf. A064288, A064289, A064290), etc.
%H <a href="/index/Rea#Recaman">Index entries for sequences related to Recamán's sequence</a>
%o rem Chipmunk BASIC v3.6.4(b8) http://www.nicholson.com/rhn/basic/
%o max=1000 : dim a(max)
%o s=2 : z=1 : a(z)=1 : print str$(z)+",";
%o for n=1 to 200
%o x=z-s : if x <= 0 then goto yyy
%o if a(x)=0 then a(x)=1 : print str$(x)+","; : s=s+1 : z=x : goto xxx
%o yyy: for i=0 to max
%o if a(x)=0 then a(x)=1 : print str$(x)+","; : s=s+i+1 : z=x : goto xxx
%o next i
%o xxx: next n
%o print : end
%o rem _Jeremy Gardiner_, Feb 22 2014
%Y Cf. A005132, A046901, A064387, A064389.
%A _N. J. A. Sloane_, Sep 28 2001
%E More terms from _David Wasserman_, Jul 16 2002