cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A322286 Lexicographically earliest sequence of positive integers without 4 terms in a weakly increasing arithmetic progression.

This page as a plain text file.
%I A322286 #31 Feb 28 2020 00:02:52
%S A322286 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,
%T A322286 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,
%U A322286 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
%N A322286 Lexicographically earliest sequence of positive integers without 4 terms in a weakly increasing arithmetic progression.
%C A322286 This is a variation of A248641 (where we only exclude weakly increasing arithmetic progressions): they differ from the 101st term.
%C A322286 It is also a variation of A309890 where 3-term is replaced by 4-term.
%C A322286 The numbers n for which the n-th term is 1 are given by A005837.
%C A322286 There is no upper bound, because if there were an upper bound r then there must be s <= r such that the set of numbers n for which the n-th term is s has positive density and this contradicts Szemerédi's theorem.
%C A322286 Assuming Erdős's conjecture on arithmetic progressions, for a fixed positive integer r, the sum of the reciprocals of the numbers n for which the n-th term is r converges.
%H A322286 Sébastien Palcoux, <a href="/A322286/b322286.txt">Table of n, a(n) for n = 1..10000</a>
%H A322286 Wikipedia, <a href="https://en.wikipedia.org/wiki/Szemerédi%27s_theorem">Szemerédi's theorem</a>
%H A322286 Wikipedia, <a href="https://en.wikipedia.org/wiki/Erdős_conjecture_on_arithmetic_progressions">Erdős conjecture on arithmetic progressions</a>
%o A322286 (SageMath)
%o A322286 cpdef FourFree(int n):
%o A322286    cdef int i,r,k,s,L1,L2,L3
%o A322286    cdef list L,Lb
%o A322286    cdef set b
%o A322286    L=[1,1,1]
%o A322286    for k in range(3,n):
%o A322286       b=set()
%o A322286       for i in range(k):
%o A322286          if 3*((k-i)/3)==k-i:
%o A322286             r=(k-i)/3
%o A322286             L1,L2,L3=L[i],L[i+r],L[i+2*r]
%o A322286             s=3*(L2-L1)+L1
%o A322286             if s>0 and L3==2*(L2-L1)+L1:
%o A322286                if L1<=L2:
%o A322286                   b.add(s)
%o A322286       if 1 not in b:
%o A322286          L.append(1)
%o A322286       else:
%o A322286          Lb=list(b)
%o A322286          Lb.sort()
%o A322286          for t in Lb:
%o A322286             if t+1 not in b:
%o A322286                L.append(t+1)
%o A322286                break
%o A322286    return L
%Y A322286 Cf. A005837, A248641, A309890.
%K A322286 nonn,easy
%O A322286 1,4
%A A322286 _Sébastien Palcoux_, Aug 28 2019