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-6 of 6 results.

A363757 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 according to the position of the second term in the pair.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 4, 1, 3, 2, 5, 4, 5, 3, 4, 6, 1, 5, 2, 6, 4, 7, 3, 7, 5, 3, 1, 4, 8, 2, 1, 6, 3, 2, 3, 8, 9, 7, 8, 7, 1, 9, 7, 8, 5, 10, 4, 3, 2, 9, 2, 6, 8, 7, 3, 11, 1, 8, 3, 1, 10, 3, 6, 9, 7, 3, 12, 5, 12, 8, 3, 8, 2, 12, 9, 1, 7, 12, 13, 4, 9, 11, 8, 4, 2, 8, 10, 1, 10, 13, 6
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jun 23 2023

Keywords

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).

Examples

			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

A363708 Lexicographically earliest sequence of positive integers such that the n-th pair of consecutive equal values are separated by a(n) terms, with pairs numbered according to the position of the first term in the pair.

Original entry on oeis.org

1, 2, 1, 3, 2, 3, 4, 5, 2, 4, 6, 5, 7, 2, 5, 4, 8, 7, 9, 10, 2, 4, 10, 11, 8, 12, 2, 10, 13, 14, 15, 13, 11, 12, 14, 16, 2, 17, 10, 2, 18, 15, 12, 13, 19, 20, 21, 14, 17, 22, 23, 17, 10, 24, 2, 13, 12, 15, 20, 12, 25, 21, 17, 26, 14, 27, 28, 22, 29, 30, 31, 32
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jun 16 2023

Keywords

Comments

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 first pair (1,2,1) encloses 1 term because a(1)=1.
The second pair (2,1,3,2) encloses 2 terms because a(2)=2.
The third pair (3,2,3) encloses 1 term because a(3)=1.
The fourth pair (2,3,4,5,2) encloses 3 terms because a(4)=3.
In constructing the sequence, we must consider whether a number forms a pair with some earlier term, and if so, whether this leads to a contradiction. If every existing term leads to a contradiction, then the smallest number not yet in the sequence is used, as in a(7)=4.
a(7)=4 because if a(7)=1, we get (1,2,1,3,2,3,1). This would have the third pair in the sequence enclose 3 terms even though a(3)=1, which is satisfied by the pair (3,2,3).
If a(7)=2: (1,2,1,3,2,3,2) would have the fourth pair (2,3,2) enclose 1 term, which is impossible because a(4)=3 means the fourth pair encloses 3 terms.
If a(7)=3: (1,2,1,3,2,3,3) would have the pair (3,3) enclosing 0 terms, yet 0 is never a term.
a(7)=4 without contradiction since 4 has not yet appeared in the sequence.
From _Kevin Ryde_, Jun 27 2023: (Start)
Backtracking can be illustrated at a(20) != 8. The following candidates are the actual a(1..19) followed by prospective 8 for a(20),
    n  = ... 14 15 16 17 18 19 20
  a(n) =  ... 2, 5, 4, 8, 7, 9, 8  <-- attempt a(20)=8
This is consistent if all of 2,5,4 pair with later terms so the 8's are pair number 14, gap a(14)=2.
But it turns out each possible value at a(21) makes such pair number 14 impossible, so no later terms can let this start work, and so must go back and change something.
(Logic could show in advance that 2,5 cannot both pair, but other impossible combinations might be more complex.)
(End)
		

Crossrefs

Extensions

More terms from Pontus von Brömssen, Jun 29 2023

A380507 Lexicographically earliest infinite sequence of positive integers such that for any n, consecutive occurrences of n are separated by a(n) terms and each subsequence enclosed by consecutive equal values is distinct.

Original entry on oeis.org

1, 2, 1, 3, 1, 3, 4, 3, 5, 3, 4, 6, 7, 8, 4, 6, 9, 7, 4, 6, 10, 11, 4, 6, 10, 12, 4, 6, 10, 13, 4, 6, 10, 14, 4, 6, 10, 13, 15, 6, 10, 16, 14, 6, 10, 13, 17, 6, 10, 18, 19, 6, 10, 13, 20, 6, 10, 18, 21, 6, 10, 13, 22, 6, 10, 18, 23, 6, 10, 13, 24, 6, 10, 18, 22
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jan 25 2025

Keywords

Comments

Endpoints are included when comparing subsequences enclosed by consecutive equal values.

Examples

			a(1) = 1 means that consecutive 1s enclose 1 term. For example: a(1..3) = [1,2,1] encloses [2].
a(2) = 2 means that consecutive 2s have length 2. In this case, there are no subsequences enclosed by a pair of 2s.
a(3) = 1 means that consecutive 3s enclose 1 term. For example, a(3..5) = [3,1,3] encloses [1].
a(7) = 4: a(7) cannot be 1 as this would repeat the subsequence [1,3,1], which was seen before at a(3..5). 2 and 3 would not enclose a(2) = 2 and a(3) = 1 terms respectively. So a(7) = 4, which has not occurred thus far.
		

Crossrefs

A380508 Lexicographically earliest sequence of positive integers such that for any n, consecutive occurrences of n are separated by a(n) distinct terms and each subsequence enclosed by consecutive equal values is distinct.

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 4, 5, 2, 5, 6, 2, 4, 6, 2, 7, 4, 2, 8, 9, 2, 4, 7, 2, 10, 4, 2, 8, 7, 2, 4, 11, 2, 10, 4, 7, 8, 12, 4, 11, 7, 10, 4, 8, 13, 7, 4, 14, 10, 8, 4, 7, 11, 15, 4, 10, 7, 8, 4, 14, 11, 7, 4, 10, 8, 16, 4, 7, 14, 10, 4, 8, 7, 11, 4, 17, 10, 7, 4, 8, 14
Offset: 1

Views

Author

Neal Gersh Tolunsky, Jan 26 2025

Keywords

Comments

Endpoints are excluded when counting the number of distinct terms enclosed.
Endpoints are included when comparing subsequences enclosed.

Examples

			a(2) = 2, so 2's enclose 2 distinct terms. For example: a(2..6) = 2,1,3,1,2 enclosing the two distinct values in 1,3,1.
a(3) = 1, so 3's enclose 1 distinct term. In this case, there are no subsequences enclosed by a pair of 3s.
a(7) = 4: a(7) cannot be 1 as this would repeat the subsequence [1,2,1], which was seen before at a(1..3). 2 and 3 would not enclose a(2) = 2 and a(3) = 1 distinct terms respectively. So a(7) = 4, which has not occurred thus far.
		

Crossrefs

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

A382911 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 according to the average index of the pair.

Original entry on oeis.org

1, 2, 1, 3, 1, 2, 4, 2, 3, 4, 2, 5, 1
Offset: 1

Views

Author

Neal Gersh Tolunsky, Apr 08 2025

Keywords

Comments

If two pairs have the same midpoint, the pair enclosing a longer subsequence is considered first (in other words, the pair with the earlier first term and later 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 terms.
The 2nd pair (2,1,3,1,2) has average index 4 and encloses a(2) = 2 distinct terms.
The 4th pair (3,1,2,4,2,3) has average index 6.5 and encloses a(4) = 3 distinct terms.
The 5th pair (2,4,2) has average index 7 and encloses a(5) = 1 term.
Notice how the 2nd term of the 5th pair a(8) = 2 occurs earlier than the 2nd term of the 4th pair a(9) = 3. Because the average index (or center of the subsequence) is earlier in the case of the pair enclosing a(4) = 3 terms, we consider it earlier than the pair enclosing a(5) = 1 terms. If after setting a(8) = 2 enclosing a(5) = 1 terms we had not been able to find a value to create a pair with an earlier average index to enclose a(4) = 3 distinct values, it would be necessary to backtrack to a(8) = 2 and try a different candidate.
		

Crossrefs

Showing 1-6 of 6 results.