%N Stopping time for Recamán-like iteration of each n: a(0) = n, a(k) = a(k-1) - k if positive and not already in the sequence, a(k) = a(k-1) + k if not already in the sequence, otherwise stop.
%C a(0) is the index of the first repeated value in Recamán's sequence (A005132).
%C a(n) appears to grow like sqrt(2n).
%e For n = 8, the Recamán-like sequence generated is 8, 7, 5, 2, 6, 1; the sequence halts after a(8) = 6 terms since 1 - 6 = -5 is negative and 1 + 6 = 7 is already in the sequence.
%o (Python 3)
%o def seqr(n):
%o sequence = [n]
%o i = 1
%o while True:
%o if n - i > 0 and n - i not in sequence:
%o n -= i
%o elif n + i not in sequence:
%o n += i
%o i += 1
%o return len(sequence)
%o print([seqr(n) for n in range(1000)])
%Y Iteration rule nearly identical to A005132.
%Y A334219 is essentially the same sequence.
%A _Kevin J. Gomez_, May 25 2019