|
|
A118251
|
|
a(1)=1. 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 > A118252(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). A118252(n) then equals m_n when written in decimal.
|
|
6
|
|
|
1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 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, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
The sequence begins 1,0,1,1,1,0,0,1,0,0,0,1,0,1,0,1,1,1,0,1,0,0,1,1. Now A118252(8) = 12, which is represented by the 0,0,1,1 at the end of the sequence. The binary representation of 13 (1011 in binary and reversed) and 14 (0111 in binary and reversed) both occur earlier in the sequence. But the binary representation of 15 (1111 in binary and reversed) does not occur earlier in the sequence, so (1,1,1,1) is added to the end of the sequence. And A118252(9) becomes 15.
|
|
MATHEMATICA
|
a = {1}; b = {1}; Do[k = b[[i - 1]] + 1; While[SequenceCount[Flatten@ a, Set[d, Reverse@ IntegerDigits[k, 2]]] != 0, k++]; a = Join[a, d]; AppendTo[b, k], {i, 2, 23}]; a (* Michael De Vlieger, Aug 21 2017 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
easy,nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|