cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A370263 Lexicographically earliest sequence such that each subsequence enclosed by a pair of equal values, excluding the endpoints, has a unique sum.

Original entry on oeis.org

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

Views

Author

Neal Gersh Tolunsky, Feb 13 2024

Keywords

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.

Examples

			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.
		

Crossrefs

Cf. A370264 (including endpoints), A366624, A366493, A366631, A366625.

Programs

  • 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

Extensions

a(16) and beyond from Michael S. Branicky, Feb 14 2024
Showing 1-1 of 1 results.