login
For a(n) even (respectively odd), there are a(n) even terms (respectively odd terms) between the only two occurrences of a(n). This is the lexicographically earliest sequence of nonnegative integers with this property.
1

%I #23 Jun 13 2022 13:22:36

%S 0,0,1,2,3,1,4,5,6,2,7,3,8,9,10,4,11,12,13,5,14,6,15,16,17,7,18,19,20,

%T 8,21,22,23,9,24,10,25,26,27,11,28,29,30,12,31,13,32,33,34,14,35,36,

%U 37,15,38,39,40,16,41,17,42,43,44,18,45,46,47,19,48,20,49,50,51,21,52,53,54,22,55

%N For a(n) even (respectively odd), there are a(n) even terms (respectively odd terms) between the only two occurrences of a(n). This is the lexicographically earliest sequence of nonnegative integers with this property.

%H Jean-Marc Falcoz, <a href="/A329849/b329849.txt">Table of n, a(n) for n = 1..10000</a>

%e Between the two 0's there are 0 terms.

%e Between the two 1's there is 1 odd term (which is 3 - we don't count 2 as 2 is even).

%e Between the two 2's there are 2 even terms (which are 4 and 6 - we don't count 3, 1 and 5 as they are odd).

%e Between the two 3's there are 3 odd terms (which are 1, 5 and 7 - we don't count 4, 6 and 2 as they are even).

%e Between the two 4's there are 4 even terms (which are 6, 2, 8 and 10 - we don't count 5, 7, 3 and 9 as they are odd).

%e Etc.

%Y Cf. A014552.

%K base,nonn

%O 1,4

%A _Eric Angelini_ and _Jean-Marc Falcoz_, Nov 22 2019