login
A378776
Lexicographically earliest sequence of positive integers such that each multiset enclosed by a pair of equal terms, including the endpoints, is distinct.
1
1, 1, 2, 1, 2, 2, 1, 3, 1, 2, 3, 1, 2, 4, 1, 2, 3, 2, 3, 1, 3, 2, 4, 2, 1, 3, 3, 4, 1, 3, 4, 1, 4, 1, 2, 3, 4, 1, 2, 4, 4, 1, 2, 5, 1, 2, 3, 4, 2, 3, 4, 1, 5, 1, 2, 3, 4, 3, 1, 5, 2, 3, 1, 4, 5, 1, 3, 2, 4, 6, 1, 2, 3, 4, 5, 1, 2, 3, 5, 2, 1, 4, 5, 2, 1, 4, 6, 1
OFFSET
1,3
COMMENTS
Note that we are considering multisets between every pair of equal values, not just those that appear consecutively.
Each positive integer occurs infinitely many times.
A new value is always followed by 1.
First differs from A366493 at a(19).
LINKS
Neal Gersh Tolunsky, Ordinal transform of 7522 terms
EXAMPLE
a(19) = 3: a(19) cannot be 1 because then a(15..19) = (1, 2, 3, 2, 1) would be the same multiset as a(6..10) = (2, 1, 3, 1, 2). a(19) cannot be 2 since this would make a(18-19) = (2,2), which is the same multiset as a(5-6). a(19) can be 3 since this does not create any repeat multiset.
PROG
(Python)
from itertools import islice
def agen(): # generator of terms
m, a = set(), []
while True:
an, allnew = 0, False
while not allnew:
allnew, an, mn = True, an+1, set()
for i in range(len(a)):
if an == a[i]:
t = tuple(sorted(a[i:]+[an]))
if t in m or t in mn: allnew = False; break
mn.add(t)
yield an; a.append(an); m |= mn
print(list(islice(agen(), 88))) # Michael S. Branicky, Dec 06 2024
CROSSREFS
Cf. A366625.
Sequence in context: A105258 A329173 A366493 * A352998 A339351 A284322
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Dec 06 2024
STATUS
approved