login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A370263
Lexicographically earliest sequence such that each subsequence enclosed by a pair of equal values, excluding the endpoints, has a unique sum.
1
1, 1, 2, 1, 2, 3, 1, 2, 4, 1, 5, 3, 6, 1, 2, 4, 7, 2, 3, 5, 6, 4, 5, 7, 8, 1, 3, 5, 2, 6, 4, 9, 10, 7, 1, 3, 8, 11, 4, 2, 8, 9, 12, 1, 3, 6, 4, 7, 11, 10, 2, 5, 8, 13, 14, 2, 9, 15, 7, 1, 3, 4, 11, 13, 12, 16, 1, 5, 14, 6, 8, 10, 9, 4, 17, 2, 10, 3, 18, 11, 16
OFFSET
1,3
COMMENTS
Two consecutive equal values enclose no terms, which have a sum of 0, and thus after [a(1), a(2)] = [1, 1] no consecutive equal values will occur again.
Note that we are considering the sums of the terms between every pair of equal values, not just those that appear consecutively.
LINKS
EXAMPLE
a(2)=1 creates the pair [a(1), a(2)] = [1, 1], which gives the unique sum of 0.
a(4)=1 creates two unique sums: [1,2,1] -> [2] = sum of 2 and [1,1,2,1] -> [1,2] = sum of 3.
a(8)=2 creates two unique sums: [2,3,1,2] -> [3,1] = sum of 4 and [2,1,2,3,1,2] -> [1,2,3,1] = sum of 7.
PROG
(Python)
from itertools import islice
def agen(): # generator of terms
s, a = set(), []
while True:
an, allnew = 0, False
while not allnew:
allnew, an, sn = True, an+1, set()
for i in range(len(a)):
if an == a[i]:
t = sum(a[i+1:])
if t in s or t in sn: allnew = False; break
sn.add(t)
yield an; a.append(an); s |= sn
print(list(islice(agen(), 81))) # Michael S. Branicky, Feb 14 2024
CROSSREFS
Cf. A370264 (including endpoints), A366624, A366493, A366631, A366625.
Sequence in context: A334430 A214614 A265692 * A376308 A194976 A195082
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Feb 13 2024
EXTENSIONS
a(16) and beyond from Michael S. Branicky, Feb 14 2024
STATUS
approved