login
A118249
a(0)=0. Concatenate onto the end of the sequence (from left to right) the integer m_n converted into binary and reversed (with the most significant digit on the right), where m_n is the smallest integer > A118250(n-1) and whose reversed binary representation does not occur anywhere earlier in the sequence (when the concatenated sequence is read from left to right). A118250(n) then equals m_n when written in decimal.
5
0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1
OFFSET
0,1
LINKS
Michael De Vlieger, Table of n, a(n) for n = 0..5167 (terms 0 <= m <= 500 flattened)
EXAMPLE
The sequence begins 0,1,1,1,0,0,1,1,0,1,0,0,0,1,0,1,0,1. Now A118250(6) = 10 (decimal), which is represented by the 0,1,0,1 at the end of the sequence. The binary representation of (decimal) 11 (1101 in binary and reversed) and 12 (0011 in binary and reversed) both occur earlier in the sequence. But the binary representation of 13 (1011 in binary and reversed) does not occur earlier in the sequence, so (1,0,1,1) is added to the end of the sequence. And A118250(7) becomes 13.
MATHEMATICA
a = {{0}}; Do[k = 1; While[SequenceCount[Flatten@ a, Set[m, Reverse@ IntegerDigits[k, 2]]] > 0, k++]; AppendTo[a, m], {i, 22}]; Flatten@ a (* Michael De Vlieger, Sep 19 2017 *)
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Leroy Quet, Apr 18 2006
EXTENSIONS
More terms from Joshua Zucker, Jul 27 2006
STATUS
approved