cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Dec 08 2024

Keywords

Comments

A "lexicographically earliest" variant of A098951.

Examples

			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.)
		

Crossrefs

Programs

  • Mathematica
    LinearRecurrence[{1, -1, 1, 100, -100, 100, -100}, {0, 1, 2, 10, 101, 21, 210, 1010, 10101}, 50] (* Paolo Xausa, Dec 09 2024 *)

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.