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.
%I A378381 #23 Nov 28 2024 11:26:22 %S A378381 1,1,2,3,2,4,3,5,6,4,7,3,8,9,5,10,6,11,12,7,13,3,14,15,16,8,17,9,18,5, %T A378381 19,20,10,21,6,22,23,11,24,12,25,26,13,27,3,28,29,30,31,14,32,15,33, %U A378381 16,34,8,35,36,17,37,9,38,39,18,40,5,41,42,43,19,44,20,45 %N A378381 Lexicographically earliest sequence such that each set of terms enclosed by two equal values, including the endpoints, contains a distinct number of elements. %C A378381 The word 'set' means that every element is unique. For example, the set {1,1,2} contains 2 elements (not 3). %C A378381 Note that we are considering sets between every pair of equal values, not just those that appear consecutively. %C A378381 Two consecutive values enclose 1 term, and thus after [a(1), a(2)] = [1, 1], no consecutive equal values occur again. %H A378381 Neal Gersh Tolunsky, <a href="/A378381/b378381.txt">Table of n, a(n) for n = 1..10000</a> %e A378381 a(4) cannot be 1 since this would create a second pair enclosing two values, [1,2,1] being an equivalent set to [1,2,1,1]. We cannot have a(4)=2 because [1,2,1] would enclose the same number of elements as [2,1,2]. So a(4)=3, which has not occurred before. %o A378381 (Python) %o A378381 from itertools import islice %o A378381 def agen(): # generator of terms %o A378381 e, a = set(), [] %o A378381 while True: %o A378381 an, allnew = 0, False %o A378381 while not allnew: %o A378381 allnew, an, ndset = True, an+1, set() %o A378381 for i in range(len(a)): %o A378381 if an == a[i]: %o A378381 nd = len(set(a[i:])) %o A378381 if nd in e or nd in ndset: allnew = False; break %o A378381 ndset.add(nd) %o A378381 yield an; a.append(an); e |= ndset %o A378381 print(list(islice(agen(), 73))) # _Michael S. Branicky_, Nov 26 2024 %Y A378381 Cf. A366691. %K A378381 nonn %O A378381 1,3 %A A378381 _Neal Gersh Tolunsky_, Nov 26 2024