A261300 Concatenate successive run lengths of 0's in the binary expansion of n, each increased by 1.
0, 1, 2, 11, 3, 21, 12, 111, 4, 31, 22, 211, 13, 121, 112, 1111, 5, 41, 32, 311, 23, 221, 212, 2111, 14, 131, 122, 1211, 113, 1121, 1112, 11111, 6, 51, 42, 411, 33, 321, 312, 3111, 24, 231, 222, 2211, 213, 2121, 2112, 21111, 15, 141, 132, 1311, 123, 1221, 1212, 12111, 114, 1131, 1122, 11211, 1113, 11121, 11112, 111111, 7, 61, 52
Offset: 0
Examples
n=2 is written "10" in binary, so following the initial digit '1', there is one (= 1) bit zero; this 1 becomes increased to yield a(2) = 2. n=3 is written "11" in binary, so following the initial digit '1', there is no (= 0) bit zero; after the next digit '1', there follow again 0 bits '0'. These two 0 are increased to yield two 1's, whence a(3) = 11.
Programs
-
PARI
A261300(n,s="",c=0)={for(i=2,#n=binary(n),c++;n[i]&&s=concat(s,c+c=0));eval(concat(s,c++))}
Formula
a(n) = Sum_{k=0..f(n)-1} T(n,k)*10^g(n,k) for n > 0 with a(0)=0 where f(n) = A000120(n), T(n,k) = T(floor(n/2),k - n mod 2) for k > 0 with T(n,0) = A001511(n), and g(n,k) = Sum_{j=0..k-1} (1 + floor(log_10(T(n,j)))). - Mikhail Kurkov, Nov 25 2019 [verification needed]
Comments