[seqfan] Re: Look left and say (binary version)

Jeremy Gardiner jeremy.gardiner at btinternet.com
Mon Nov 18 18:54:12 CET 2019


Communication with M. F. Hasler has prompted me to consider the case where
we do not append the digit being counted.

That is, replace this line in my program:
s$=s$+bin$(s)+b$

With this line:
s$=s$+bin$(s)

Now starting at 1 and counting 1's we have:

>run "/sequences/leftbits.bas"
1,2,3,5,7,10,12,14,17,19,22,25,28,31,36,38,41,44,47,52,55,60,64,65,67,70,73,
76,79,84,
1110111011111010110011101000110011101101100111100111111001001001101010011011
0010111111010011011111110010000001000001100001110001101001001100110010011111
010100

The intermediate values here give A010062: a(0)=1; thereafter a(n+1) = a(n)
+ number of 1's in binary representation of a(n).

Regards,
Jeremy Gardiner





More information about the SeqFan mailing list