OFFSET
1,2
COMMENTS
The word 'distinct' differentiates this sequence from A363654.
A000124 gives the index of the first occurrence of n, and A080036 gives the indices of the remaining terms. A record high term occurs when its corresponding pair number would be the previous record high, since that would have to use all terms between the enclosing pair, which is impossible.
A083920(n) gives the number of pairs in the first n terms of this sequence.
If pairs are numbered according to the position of the first term in the pair (rather than second), this becomes A001511 (the ruler function).
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Neal Gersh Tolunsky, Graph of first 100000 terms
EXAMPLE
The 1st pair (1,2,1) encloses 1 term because a(1)=1.
The 2nd pair (2,1,3,2) encloses 2 distinct terms because a(2)=2.
The 3rd pair (3,2,3) encloses 1 term because a(3)=1.
The 4th pair (1,3,2,3,4,1) encloses 3 distinct terms because a(4)=3.
a(4)=3 since if we place a 1 or a 2 (creating the second pair), this would enclose less than a(2)=2 distinct terms, so a(4) must be the smallest unused number, which is 3.
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Jun 23 2023
STATUS
approved