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 A382908 #20 Apr 23 2025 10:37:00 %S A382908 1,2,1,3,2,3,4,1,3,2,5,2,4,3,2,4,6,3,5,1,3,7,5,6,5,2,1 %N A382908 Lexicographically earliest sequence of positive integers such that the n-th pair of consecutive equal values are separated by a(n) distinct terms, with pairs numbered by their average index. %C A382908 If two pairs have the same midpoint, the pair enclosing a shorter subsequence is considered first (in other words, the pair with the later first term and earlier second term). %C A382908 Calculating terms may require backtracking, since pair numbers are not fixed until enough later terms either do or don't pair with earlier terms. %e A382908 The 1st pair (1,2,1) has average index 2 and encloses a(1) = 1 term. %e A382908 The 2nd pair (2,1,3,2) has average index 3.5 and encloses a(2) = 2 distinct terms. %e A382908 The 7th pair (4,1,3,2,5,2,4) has average index 10 and encloses a(7) = 4 distinct terms {1,2,3,5}. %e A382908 The 8th pair (2,5,2) has average index 11 and encloses a(8) = 1 term. %e A382908 Notice how the 2nd term of the 8th pair a(12) = 2 occurs earlier than the 2nd term of the 7th pair a(13) = 4. Because the average index (or center of the subsequence) is earlier in the case of the pair enclosing a(7) = 4 distinct terms, we consider it earlier than the pair enclosing a(8) = 1 term. If after setting a(12) = 2 enclosing a(8) = 1 term we had not been able to find a value to create a pair with an earlier average index to enclose a(7) = 4 distinct values, it would be necessary to backtrack to a(12) = 2 and try a different candidate. %Y A382908 Cf. A382911, A363757, A363708, A363654. %K A382908 nonn,more %O A382908 1,2 %A A382908 _Neal Gersh Tolunsky_, Apr 08 2025