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.

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.

Original entry on oeis.org

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
Offset: 1

Views

Author

Neal Gersh Tolunsky, Apr 08 2025

Keywords

Comments

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).
Calculating terms may require backtracking, since pair numbers are not fixed until enough later terms either do or don't pair with earlier terms.

Examples

			The 1st pair (1,2,1) has average index 2 and encloses a(1) = 1 term.
The 2nd pair (2,1,3,2) has average index 3.5 and encloses a(2) = 2 distinct terms.
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}.
The 8th pair (2,5,2) has average index 11 and encloses a(8) = 1 term.
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.
		

Crossrefs

Showing 1-1 of 1 results.