OFFSET
0,2
COMMENTS
Define sequences a(n) and b(n) recursively, starting with a(0) = 1, a(1) = 2:
b(n) = least new;
a(n) = 2*a(n-1) - a(n-2) + b(n),
where "least new" means the least positive integer not yet placed. It appears that a(n)/a(n-1) -> 1, that {a(n) - a(n-1), n>=1} is unbounded, and that the 3rd difference sequence of (a(n)) consists entirely of 1's and 2's.
LINKS
Clark Kimberling, Table of n, a(n) for n = 0..10000
EXAMPLE
b(0) = least not in {a(0), a(1)} = 3;
a(2) = 2*a(1) - a(0) + b(2) must exceed = 2*2 -1 + 5 = 8, so that b(0) = 3, b(1) = 4, b(2) = 5, b(3) = 6, b(4) =7, and a(2) = 8.
MATHEMATICA
a = {1, 2}; b = {3, 4, 5};
mex[list_, start_] := (NestWhile[# + 1 &, start, MemberQ[list, #] &]);
Do[AppendTo[a, 2 Last[a] - a[[-2]] + Last[b]];
AppendTo[b, mex[Flatten[{a, b}], Last[b]]], {200}]; a
(* Peter J. C. Moses, May 30 2018 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 30 2018
STATUS
approved