login
A291712
Lexicographically earliest sequence of positive terms such that, for any m and n > 0, if m < n then a(m) != a(n) or a(m+1) != a(n+1), and if n = least k > m such that a(k) = a(m) then m and n have a different parity.
1
1, 1, 2, 2, 1, 3, 2, 4, 3, 1, 4, 2, 5, 3, 3, 4, 1, 5, 2, 3, 5, 1, 6, 2, 7, 5, 4, 4, 5, 5, 8, 6, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 3, 7, 1, 8, 2, 9, 5, 10, 4, 11, 7, 3, 6, 4, 8, 1, 9, 2, 10, 6, 6, 5, 12, 6, 11, 8, 4, 7, 6, 9, 1, 10, 2, 6, 7, 4, 6, 12, 3, 11, 4
OFFSET
1,3
COMMENTS
If we drop the constraint "if n = least k > m such that a(k) = a(m) then m and n have a different parity" then we obtain the natural numbers interspersed with 1's: 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, ...
Conjecturally, (a(n), a(n+1)) uniquely runs over all pairs of positive integers (this is the motivation for this sequence).
This sequence has similarities with:
- A226005 whose pairs of consecutive terms run over all pairs of positive integers,
- A290633 whose pairs of consecutive terms (conjecturally) run over all pairs of noncoprime positive integers.
The representation of the first pairs of consecutive terms has nice features.
EXAMPLE
a(1) = 1 is suitable.
a(2) = 1 is suitable.
a(3) cannot equal 1 as the pair (1,1) has already been visited.
a(3) = 2 is suitable.
a(4) cannot equal 1 as the previous occurrence of 1 happened at even index.
a(4) = 2 is suitable.
a(5) = 1 is suitable.
a(6) cannot equal 1 as the pair (1,1) has already been visited.
a(6) cannot equal 2 as the previous occurrence of 2 happened at even index.
a(6) = 3 is suitable.
PROG
(PARI) See Links section.
CROSSREFS
Sequence in context: A339491 A346871 A375300 * A074945 A353068 A367292
KEYWORD
nonn
AUTHOR
Rémy Sigrist, Aug 30 2017
STATUS
approved