%I #10 Aug 31 2017 04:47:14
%S 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,
%T 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,
%U 12,6,11,8,4,7,6,9,1,10,2,6,7,4,6,12,3,11,4
%N 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.
%C 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, ...
%C Conjecturally, (a(n), a(n+1)) uniquely runs over all pairs of positive integers (this is the motivation for this sequence).
%C This sequence has similarities with:
%C - A226005 whose pairs of consecutive terms run over all pairs of positive integers,
%C - A290633 whose pairs of consecutive terms (conjecturally) run over all pairs of noncoprime positive integers.
%C The representation of the first pairs of consecutive terms has nice features.
%H Rémy Sigrist, <a href="/A291712/b291712.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A291712/a291712.png">Colorized scatterplot of the first 10 000 000 pairs of consecutive terms</a>
%H Rémy Sigrist, <a href="/A291712/a291712.gp.txt">PARI program for A291712</a>
%e a(1) = 1 is suitable.
%e a(2) = 1 is suitable.
%e a(3) cannot equal 1 as the pair (1,1) has already been visited.
%e a(3) = 2 is suitable.
%e a(4) cannot equal 1 as the previous occurrence of 1 happened at even index.
%e a(4) = 2 is suitable.
%e a(5) = 1 is suitable.
%e a(6) cannot equal 1 as the pair (1,1) has already been visited.
%e a(6) cannot equal 2 as the previous occurrence of 2 happened at even index.
%e a(6) = 3 is suitable.
%o (PARI) See Links section.
%Y Cf. A226005, A290633.
%K nonn
%O 1,3
%A _Rémy Sigrist_, Aug 30 2017
|