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, 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
Keywords
Examples
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.
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Colorized scatterplot of the first 10 000 000 pairs of consecutive terms
- Rémy Sigrist, PARI program for A291712
Programs
-
PARI
See Links section.
Comments