OFFSET
1,2
COMMENTS
For the nonnegative sequence, see A240556, which is this sequence minus 1. Is there a simple way of determining this sequence, as in the case of the no 3-term arithmetic progression?
See crossreferences for sequences avoiding arithmetic progressions. - M. F. Hasler, Jan 12 2016
MATHEMATICA
t = {1, 2, 3, 4}; Do[s = Table[Append[i, n], {i, Subsets[t, {4}]}]; If[! MemberQ[Flatten[Table[Differences[i, 4], {i, s}]], 0], AppendTo[t, n]], {n, 5, 5000}]; t
PROG
(PARI) A240557(n, show=0, L=5, o=3, v=[1], D=v->v[2..-1]-v[1..-2])={ my(d, m); while( #v<n, show&&print1(v[#v]", "); v=concat(v, v[#v]); while( v[#v]++, forvec( i=vector(L, j, [if(j<L, j, #v), #v]), d=D(vecextract(v, i)); m=o; while(m--&&#Set(d=D(d))>1, ); #Set(d)>1||next(2), 2); break)); v[#v]} \\ M. F. Hasler, Jan 12 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Apr 09 2014
EXTENSIONS
Definition corrected by M. F. Hasler, Jan 12 2016
STATUS
approved