login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Numbers k such that LR0(k) > LR1(k), where LR0(k) = A087117(k) is the length of the longest run of zeros in the binary representation of k, LR1(k) = A038374(k) is the length of the longest run of ones.
2

%I #11 Dec 07 2019 12:18:27

%S 0,4,8,9,16,17,18,20,24,32,33,34,35,36,37,40,41,48,49,64,65,66,67,68,

%T 69,70,72,73,74,80,81,82,84,88,96,97,98,99,104,112,128,129,130,131,

%U 132,133,134,135,136,137,138,139,140,141,144,145,146,148,149,152,160

%N Numbers k such that LR0(k) > LR1(k), where LR0(k) = A087117(k) is the length of the longest run of zeros in the binary representation of k, LR1(k) = A038374(k) is the length of the longest run of ones.

%H Harvey P. Dale, <a href="/A237882/b237882.txt">Table of n, a(n) for n = 1..1000</a>

%t klrQ[n_]:=With[{sidn2=Split[IntegerDigits[n,2]]},Max[Length/@Select[sidn2,#[[1]]==0&]]>Max[Length/@Select[sidn2,#[[1]]==1&]]]; Select[Range[ 0,200],klrQ] (* _Harvey P. Dale_, May 05 2018 *)

%o (Python)

%o for n in range(1000):

%o b = bin(n).lstrip("0b")

%o L0 = L1 = 0

%o s = '0'

%o if n==0: b=s

%o while b.find(s)>=0:

%o s += '0'

%o L0 += 1

%o s = '1'

%o while b.find(s)>=0:

%o s += '1'

%o L1 += 1

%o if L0>L1: print str(n)+',',

%Y Cf. A038374, A087117.

%Y Cf. A090050 (numbers k such that LR0(k) = LR1(k)).

%Y Cf. A237883 (numbers k such that LR0(k) < LR1(k)).

%K nonn,base

%O 1,2

%A _Alex Ratushnyak_, Feb 14 2014