login
A051203
Least inverse of A005210.
2
3, 1, 4, 5, 35, 10, 8, 26, 15, 38, 20, 13, 55, 78, 27, 70, 68, 53, 36, 282, 44, 73, 75, 69, 64, 34, 32, 585, 51, 30, 139, 165, 72, 121, 535, 97, 83, 253, 67, 469, 168, 61, 147, 146, 59, 93, 123, 286, 815, 1398, 112, 294, 119, 129, 347, 138, 124, 81, 144, 194, 256, 142
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
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
Cf. A005210.
Sequence in context: A050057 A104449 A116416 * A243553 A286159 A307394
KEYWORD
nonn
STATUS
approved