login
Binary sequence starting with 1 and with run lengths given by the ruler sequence A001511.
2

%I #21 Jul 12 2022 14:35:55

%S 1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,

%T 1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,

%U 0,0,1,0,0,1,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0,1

%N Binary sequence starting with 1 and with run lengths given by the ruler sequence A001511.

%C Inspired by _Jeremy Gardiner_'s sequence A253585.

%o (PARI) concat(vector(50,n,if(1<m=A001511(n),vector(m),1)))

%o (Python 3.10+)

%o def A252488_gen(): # generator of terms

%o m = 0

%o for n in count(0):

%o yield from [0]*(-m-1+(m:=(n<<2)-n.bit_count()))

%o yield 1 # _Chai Wah Wu_, Jul 12 2022

%Y Cf. A001511, A253585.

%Y The 1's are located at indices given by A005187(2n+1) = A005187(2n)+1 = A120738(n)+1. - _N. J. A. Sloane_ and _M. F. Hasler_, Jan 22 2015

%K nonn

%O 1

%A _M. F. Hasler_, Jan 13 2015