A267650 Stanley sequence S_4(0,3): lexicographic first increasing sequence with a(0) = 0, a(1) = 3 and no 4 terms in arithmetic progression.
0, 3, 4, 5, 7, 8, 10, 11, 16, 17, 18, 20, 21, 27, 28, 29, 31, 32, 34, 35, 36, 53, 55, 56, 57, 60, 61, 62, 64, 67, 69, 75, 87, 91, 100, 101, 103, 104, 105, 108, 109, 110, 114, 116, 120, 125, 127, 128, 129, 132, 134, 135, 164, 168, 173, 174, 175, 177, 181, 182, 184, 188, 190
Offset: 0
Keywords
Crossrefs
Programs
-
PARI
a(n,show=1,L=4,v=[0,3], D=v->v[2..-1]-v[1..-2])={while(#v<=n, show&&print1(v[#v]", "); v=concat(v, v[#v]); while(v[#v]++, forvec(i=vector(L, j, [if(j
1||next(2), 2); break)); if(type(show)=="t_VEC", v, v[n+1])} \\ 2nd (optional) arg: zero = silent, nonzero = verbose, vector (e.g. [] or [1]) = get the whole list [a(1..n)] as return value, else just a(n). - M. F. Hasler, Jan 18 2016
Comments