VOOZH about

URL: https://oeis.org/A377919

⇱ A377919 - OEIS


login
A377919
a(0) = 0; thereafter a(n) is the lexicographically earliest missing nonnegative integer such that the digits in the sequence (ignoring the commas) alternate in parity.
2
0, 1, 2, 10, 101, 21, 210, 1010, 10101, 2101, 21010, 101010, 1010101, 210101, 2101010, 10101010, 101010101, 21010101, 210101010, 1010101010, 10101010101, 2101010101, 21010101010, 101010101010, 1010101010101, 210101010101, 2101010101010, 10101010101010, 101010101010101, 21010101010101, 210101010101010, 1010101010101010, 10101010101010101, 2101010101010101, 21010101010101010, 101010101010101010
OFFSET
0,3
COMMENTS
A "lexicographically earliest" variant of A098951.
FORMULA
a(0) - a(6) are 0, 1, 2, 10, 101, 21, 210. Thereafter, for k >= 2,
a(4*k-1) = a(4*k-5) || 10,
a(4*k) = a(4*k-4) || 01,
a(4*k+1) = a(4*k-3) || 01,
a(4*k+2) = a(4*k-2) || 10,
where || denotes concatenation.
EXAMPLE
We begin by arranging the nonnegative integers whose digits alternate in parity in lexicographic order. First, 0; then the numbers with first digit 1: 1, 10, 101, 1010, 10101, 101010, ...; then the numbers with first digit 2: 2, 20, 201, 2010, 20101, 201010, ...; then the numbers with first digit 3, and so on.
The sequence begins with 0 and from then on we choose the first unused number from the above list which preserves alternating parity of the digits in the sequence.
(The above list does not have an OEIS entry, since there are uncountably many terms before the number 2 appears. In fact there are uncountably many terms before 12 appears. The beginning of the list coincides with A056830.)
MATHEMATICA
LinearRecurrence[{1, -1, 1, 100, -100, 100, -100}, {0, 1, 2, 10, 101, 21, 210, 1010, 10101}, 50] (* Paolo Xausa, Dec 09 2024 *)
CROSSREFS
Sequence in context: A324241 A188193 A228120 * A074109 A385840 A291101
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Dec 08 2024
STATUS
approved