

A277861


A selfdescribing sequence: the zeros and ones in the decimal representation of the sequence correspond to the binary representation of the sequence.


2



1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 13, 32, 33, 34, 35, 36, 37, 38, 39, 40, 14, 15, 16, 42, 43, 44, 45, 46, 47, 48, 49, 50, 17, 18, 19, 21, 52, 53, 54, 55, 56, 57, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

The sequence is always extended with the smallest integer not yet present and not leading to a contradiction.
Numbers with neither 0 nor 1 in their decimal representation appear in increasing order.
Here is another way to state the condition that the sequence must satisfy.
For each n, let D denote the concatenation of the first n terms in base 10, and let B denote the concatenation of the first n terms in base 2. Let D' be obtained from D by deleting all digits except 0 and 1.
Then D' must be a prefix of B.
In the examples below, D' appears in parentheses.
A278030 shows indices where the sequence changes from on or below the diagonal (a(n)<=n) to above the diagonal (a(n)>n), or vice versa. (End)


LINKS



EXAMPLE

When computing the sequence, we must check that for any n > 0, the zeros and ones among the decimal representation of the first n terms match the beginning of the binary representation of these terms.
The following table depicts the first terms, alongside their binary representation, and the matching zeros and ones among their decimal representation (in parentheses):
n a(n) a(n) in binary First n terms in binary
   
1 1 1 (1)
2 2 10 (1)10
3 3 11 (1)1011
4 4 100 (1)1011100
5 5 101 (1)1011100101
6 6 110 (1)1011100101110
7 7 111 (1)1011100101110111
8 8 1000 (1)10111001011101111000
9 9 1001 (1)101110010111011110001001
10 10 1010 (110)11100101110111100010011010
11 11 1011 (11011)1001011101111000100110101011
12 12 1100 (110111)0010111011110001001101010111100
13 20 10100 (1101110)01011101111000100110101011110010100


CROSSREFS



KEYWORD

nonn,base


AUTHOR



STATUS

approved



