|
|
A309890
|
|
Lexicographically earliest sequence of positive integers without triples in weakly increasing arithmetic progression.
|
|
6
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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).
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
|
|
|
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
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|