A309890 Lexicographically earliest sequence of positive integers without triples in weakly increasing arithmetic progression.
1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2, 4, 4, 5, 5, 8, 5, 5, 9, 1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2, 4, 4, 5, 5, 8, 5, 5, 9, 2, 4, 4, 5, 5, 10, 5, 5, 10, 10, 11, 13, 10, 11, 10, 11, 13, 10, 10, 12, 13, 10, 13, 11, 12, 20, 11, 1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2
Offset: 1
Links
- Sébastien Palcoux, Table of n, a(n) for n = 1..100000
- Sébastien Palcoux, On the first sequence without triple in arithmetic progression (version: 2019-08-21), second part, MathOverflow
- Sébastien Palcoux, Table of n, a(n) for n = 1..1000000
- Sébastien Palcoux, Density plot of the first 1000000 terms
Programs
-
Python
from itertools import count, islice def A309890_gen(): # generator of terms blist = [] for n in count(0): i, j, b = 1, 1, set() while n-(i<<1) >= 0: x, y = blist[n-2*i], blist[n-i] z = (y<<1)-x if x<=y<=z: b.add(z) while j in b: j += 1 i += 1 blist.append(j) yield j A309890_list = list(islice(A309890_gen(),30)) # Chai Wah Wu, Sep 12 2023
-
SageMath
# %attach SAGE/ThreeFree.spyx from sage.all import * cpdef ThreeFree(int n): cdef int i,j,k,s,Li,Lj cdef list L,Lb cdef set b L=[1,1] for k in range(2,n): b=set() for i in range(k): if 2*((i+k)/2)==i+k: j=(i+k)/2 Li,Lj=L[i],L[j] s=2*Lj-Li if s>0 and Li<=Lj: 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