login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 1

%I #8 Jan 18 2016 22:23:22

%S 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,

%T 60,61,62,64,67,69,75,87,91,100,101,103,104,105,108,109,110,114,116,

%U 120,125,127,128,129,132,134,135,164,168,173,174,175,177,181,182,184,188,190

%N Stanley sequence S_4(0,3): lexicographic first increasing sequence with a(0) = 0, a(1) = 3 and no 4 terms in arithmetic progression.

%C See A185256 for S(0,3) = S_3(0,3) and A266728 for S_5(0,3).

%H <a href="/index/St#Stanley">Index entries related to Stanley sequences</a>

%o (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<L, j, #v), #v]), #Set(D(vecextract(v, i)))>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

%Y For other examples of Stanley Sequences see A005487, A005836, A187843, A188052, A188053, A188054, A188055, A188056, A188057, A266727, A266728.

%Y See also A004793, A033160, A033163.

%K nonn

%O 0,2

%A _M. F. Hasler_, Jan 18 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 07:53 EDT 2024. Contains 371964 sequences. (Running on oeis4.)