OFFSET
1,3
LINKS
EXAMPLE
For n=4: m=2 works, because 2 is not in a, 2-3=-1 is not in b, and 2-1=1 is not in c; set a(4)=2, b(3)=-1 and c(2)=1.
For n=5: m=5 works, because 5 is not in a, 5-2=3 is not in b, and 5-3=2 is not in c; set a(5)=5, b(4)=3 and c(3)=2.
MATHEMATICA
a = {0, 1};
d1 = {1};
d2 = {};
For[n = 3, n <= 10000, n++,
For[t = Min[Complement[Range[Max[n]], a]], t <= Infinity, t++,
If[MemberQ[a, t] == False,
If[MemberQ[d1, t - a[[n - 1]]] == False && MemberQ[d2, t - a[[n - 2]]] == False, Break[]; ]]];
a = Flatten[Append[a, t]];
d1 = Flatten[Append[d1, t - a[[n - 1]]]];
d2 = Flatten[Append[d2, t - a[[n - 2]]]]; ]
CROSSREFS
KEYWORD
nonn
AUTHOR
Luca Petrone, May 14 2018
EXTENSIONS
Edited by N. J. A. Sloane, Jun 25 2018.
STATUS
approved