OFFSET
1,3
COMMENTS
Formal definition: lexicographically earliest sequence of positive integers a(n) such that for any i > 0, there is no n > 0 such that 2a(n+i) = a(n) + a(n+2i) AND a(n) <= a(n+i) <= a(n+2i).
Sequence suggested by Richard Stanley as a variant of A229037. They differ from the 55th term. The numbers n for which a(n) = 1 are given by A003278, or equally by A005836 (Richard Stanley).
The sequence defined by c(n) = 1 if a(n) = 1 and otherwise c(n) = 0 is A039966 (although with a different offset). - N. J. A. Sloane, Dec 01 2019
Pleasant to listen to (button above) with Instrument no. 13: Marimba (and for better listening, save and convert to MP3).
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
PROG
(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
(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
CROSSREFS
AUTHOR
Sébastien Palcoux, Aug 21 2019
STATUS
approved