A322286 Lexicographically earliest sequence of positive integers without 4 terms in a weakly increasing arithmetic progression.
1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 3, 1, 1, 1, 2, 1, 2, 2, 2, 3, 3, 3, 1, 1, 3, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 2, 3, 3, 2, 3, 2, 3, 3, 5, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 2, 2, 2, 3, 1, 2, 1, 1, 1, 2, 2, 2, 3, 4, 2, 3, 2, 2, 2, 3, 3, 1, 3, 3, 3, 5, 5, 4, 1, 1, 1, 3, 1, 2, 3, 1, 5, 3, 2, 6, 1, 3, 2, 1, 3, 2, 1, 1, 3, 3, 1, 1, 1
Offset: 1
Links
- Sébastien Palcoux, Table of n, a(n) for n = 1..10000
- Wikipedia, Szemerédi's theorem
- Wikipedia, Erdős conjecture on arithmetic progressions
Programs
-
SageMath
cpdef FourFree(int n): cdef int i,r,k,s,L1,L2,L3 cdef list L,Lb cdef set b L=[1,1,1] for k in range(3,n): b=set() for i in range(k): if 3*((k-i)/3)==k-i: r=(k-i)/3 L1,L2,L3=L[i],L[i+r],L[i+2*r] s=3*(L2-L1)+L1 if s>0 and L3==2*(L2-L1)+L1: if L1<=L2: b.add(s) if 1 not in b: L.append(1) else: Lb=list(b) Lb.sort() for t in Lb: if t+1 not in b: L.append(t+1) break return L
Comments