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.

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

This page as a plain text file.
%I A370263 #15 Feb 17 2024 12:41:29
%S A370263 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,
%T A370263 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,
%U A370263 12,16,1,5,14,6,8,10,9,4,17,2,10,3,18,11,16
%N A370263 Lexicographically earliest sequence such that each subsequence enclosed by a pair of equal values, excluding the endpoints, has a unique sum.
%C A370263 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.
%C A370263 Note that we are considering the sums of the terms between every pair of equal values, not just those that appear consecutively.
%H A370263 Michael S. Branicky, <a href="/A370263/b370263.txt">Table of n, a(n) for n = 1..10000</a>
%e A370263 a(2)=1 creates the pair [a(1), a(2)] = [1, 1], which gives the unique sum of 0.
%e A370263 a(4)=1 creates two unique sums: [1,2,1] -> [2] = sum of 2 and [1,1,2,1] -> [1,2] = sum of 3.
%e A370263 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.
%o A370263 (Python)
%o A370263 from itertools import islice
%o A370263 def agen(): # generator of terms
%o A370263     s, a = set(), []
%o A370263     while True:
%o A370263         an, allnew = 0, False
%o A370263         while not allnew:
%o A370263             allnew, an, sn = True, an+1, set()
%o A370263             for i in range(len(a)):
%o A370263                 if an == a[i]:
%o A370263                     t = sum(a[i+1:])
%o A370263                     if t in s or t in sn: allnew = False; break
%o A370263                     sn.add(t)
%o A370263         yield an; a.append(an); s |= sn
%o A370263 print(list(islice(agen(), 81))) # _Michael S. Branicky_, Feb 14 2024
%Y A370263 Cf. A370264 (including endpoints), A366624, A366493, A366631, A366625.
%K A370263 nonn
%O A370263 1,3
%A A370263 _Neal Gersh Tolunsky_, Feb 13 2024
%E A370263 a(16) and beyond from _Michael S. Branicky_, Feb 14 2024