OFFSET
1,3
COMMENTS
In other words: The absolute distance between the indices of any two terms (A and B) is distinct among all pairs of terms in the sequence with the same two values (A and B).
No value can occur more than twice: 1) If two terms have the same value, one term must be at an odd index and the other at an even index. Otherwise we would have a middle term B equidistant from two equal terms in an ABA-form progression, which contradicts the sequence's definition. 2) So we can have at most one term with a given value at an even index and one at an odd index.
Any unordered pair (A, B) has a maximum of 4 distinct distances (A1 to B1, A1 to B2, A2 to B1, A2 to B2).
For the equivalent sequence using ordered pairs, see A337226.
EXAMPLE
a(7)=5: We cannot have a(7)=1 because then, for example, the unordered pair (1,2) would have the same absolute distance twice at distinct indices:
1, 1, 2, 3, 4, 2, 1
1--2 2--1
a(7) could not equal 2 because again the pair (1,2) would have the same absolute distance twice at different indices (i=6-1=5 and i=7-2=5):
1, 1, 2, 3, 4, 2, 2
1--------------2
1--------------2
a(7) cannot be 3 because of the following two equal unordered pairs, which would have the same distance:
1, 1, 2, 3, 4, 2, 3
2--3 2--3
a(7) cannot be 4, or we would have two equal unordered pairs both with distance 1:
1, 1, 2, 3, 4, 2, 4
4--2
2--4
a(7) can be 5 without restriction since 5 is a first occurrence and every unordered pair with 5 has a distinct distance.
CROSSREFS
KEYWORD
nonn
AUTHOR
Neal Gersh Tolunsky, Jan 22 2024
STATUS
approved