OFFSET
0,1
COMMENTS
From Clark Kimberling, Feb 25 2018: (Start)
Solution a( ) of the complementary equation a(n) = b(n-1) + b(n-3), where a(0) = 2, a(1) = 3, a(2) = 5.
From the Bode-Harborth-Kimberling link:
a(n) = b(n-1) + b(n-3) for n > 3;
b(0) = least positive integer not in {a(0),a(1),a(2)};
b(n) = least positive integer not in {a(0),...,a(n),b(0),...,b(n-1)} for n > 1.
Note that (b(n)) is strictly increasing and is the complement of (a(n)).
See A022424 for a guide to related sequences.
(End)
LINKS
Ivan Neretin, Table of n, a(n) for n = 0..10000
J-P. Bode, H. Harborth, C. Kimberling, Complementary Fibonacci sequences, Fibonacci Quarterly 45 (2007), 254-264.
MATHEMATICA
Fold[Append[#1, Plus @@ Complement[Range[Max@#1 + 3], #1][[{#2, #2 + 2}]]] &, {2, 3, 5}, Range[43]] (* Ivan Neretin, Mar 30 2017 *)
mex := First[Complement[Range[1, Max[#1] + 1], #1]] &;
a[0] = 2; a[1] = 3; a[2] = 5; b[0] = 1; b[1] = 4;
a[n_] := a[n] = b[n - 1] + b[n - 3];
b[n_] := b[n] = mex[Flatten[Table[Join[{a[n]}, {a[i], b[i]}], {i, 0, n - 1}]]];
Table[a[n], {n, 0, 100}] (* A022438 *)
Table[b[n], {n, 0, 100}] (* A299540 *)
(* Clark Kimberling, Feb 25 2018 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved