[seqfan] A167500 List of nonzero bits in this sequence (when terms are written in binary and concatenated).
maximilian.hasler at gmail.com
Thu Nov 5 16:41:32 CET 2009
Speaking of binary representation, and having in mind some of Eric's
earlier ideas, made me think of the following, which to some
astonishment was not yet in the OEIS.
Any comments are welcome.
%N A167500 List of nonzero bits in this sequence (when terms are
written in binary and concatenated).
%S A167500 1,2,4,7,8,9,10,14,17,18,20,22,23,24,26,30,31,34,36,38,41,43,44,46,48,
%T A167500 49,50,51,52,56,57,59,61,62,63,64,66,67,68,69,70,71,75,77,80,83,86,87,
%U A167500 89,91,94,95,97,99,100,101,103,104,107,109,110,111,113,114,119,120,124
%C A167500 Numbers are written in base 2 in the usual way, starting
with the most significant bit (MSB).
%C A167500 The sequence starts at index 1 since it is a list. The
sequence cannot start with a(1)=0, else the 0-th bit would not be
nonzero. Thus we don't have the choice of numbering the bits starting
from zero, and the first bit is necessarily set (the MSB of the first
term which is nonzero), i.e., a(1)=1.
%e A167500 The term which follows a(1)=1 (cf. comment) will be nonzero
and thus have a nonzero MSB, which is the bit that comes right after
the initial 1, thus bit # 2 is nonzero, therefore a(2)=2.
%e A167500 This term is written 10 in base 2, so the third bit of the
sequence is zero, but the 4-th bit, which will follow, will be the MSB
of a(3) which is nonzero, thus a(3)=4.
%e A167500 The 4-th bit is followed by two zero bits (since 4 =
100), but the 7-th bit is the MSB of the next term, thus nonzero,
and therefore a(4)=7.
%e A167500 Since 7=111, the 8-th and 9-th bits are also set, i.e.,
the sequence continues a(5)=8, a(6)=9, and from now on, there is
always a growing number of subsequent bits already written down.
%o A167500 (PARI) a=b=; for(n=1,99, #b >= n & for( i=a[n-1]+1,#b,
b[i] & (a=concat(a,i)) & break); #a<n & a=concat(a,#b+1);
b=concat(b,binary( a[n] ))); a
%Y A167500 Cf. A167501 (the sequence of bits of this sequence),
A167502 (this sequence written in binary).
%K A167500 base,nonn
%O A167500 1,2
%A A167500 M. F. Hasler (MHasler(AT)univ-ag.fr), Nov 05 2009
More information about the SeqFan