login
A373082
Number of runs of 0's in A014550(n).
0
1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 0, 1, 2, 1, 1, 1, 2, 2, 2, 3, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 3
OFFSET
0,13
PROG
(Python)
def count_zero_runs_in_binary(n):
binRep = bin(n)[2:] # as binary, but ignore "0b" prefix
zRuns = binRep.split('1') # split on the 1's
zRvec = [run for run in zRuns if run] # filter "" to get runs of 0
return len(zRvec)
out = []
for i in range(100):
gv = i ^ (i>>1) # gray code
ans = count_zero_runs_in_binary(gv)
out.append(ans)
print(out)
CROSSREFS
Cf. A014550.
Sequence in context: A194852 A158854 A376632 * A119849 A246588 A026492
KEYWORD
nonn,base
AUTHOR
James S. DeArmon, May 22 2024
STATUS
approved