OFFSET
0,1
COMMENTS
It seems likely that every number eventually appears in A005210, so this sequence is probably well-defined. - N. J. A. Sloane, Apr 16 2015
REFERENCES
Popular Computing (Calabasas, CA), Z-Sequences, Vol. 4 (No. 42, Sep 1976), pp. 12-16.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..20000
Popular Computing (Calabasas, CA), Z-Sequences, continued. Annotated and scanned copy of pages 14, 15, 16, 18 of Vol. 5 (No. 56, Nov 1977).
MAPLE
b:= proc(n) option remember;
`if`(n<3, 1, abs(b(n-1)+2*b(n-2)-n))
end:
a:= proc() local t, a; t, a:= 0, proc() -1 end;
proc(n) local h;
while a(n) = -1 do
t:= t+1; h:= b(t);
if a(h) = -1 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=0..100); # Alois P. Heinz, Apr 16 2015
MATHEMATICA
nMax = 100; bMax = 2000;
b[n_] := b[n] = If[n < 3, 1, Abs[b[n-1] + 2*b[n-2] - n]];
a[n_] := (For[k = 1, k <= bMax, k++, If[b[k] == n, Return[k]]]; -1);
Table[a[n], {n, 0, nMax}] (* Jean-François Alcover, Apr 05 2017 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved