cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A373082 Number of runs of 0's in A014550(n).

This page as a plain text file.
%I A373082 #6 May 31 2024 14:05:05
%S A373082 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,
%T A373082 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,
%U A373082 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
%N A373082 Number of runs of 0's in A014550(n).
%o A373082 (Python)
%o A373082 def count_zero_runs_in_binary(n):
%o A373082     binRep = bin(n)[2:]   # as binary, but ignore "0b" prefix
%o A373082     zRuns = binRep.split('1')  # split on the 1's
%o A373082     zRvec = [run for run in zRuns if run] # filter "" to get runs of 0
%o A373082     return len(zRvec)
%o A373082 out = []
%o A373082 for i in range(100):
%o A373082     gv = i ^ (i>>1)   # gray code
%o A373082     ans = count_zero_runs_in_binary(gv)
%o A373082     out.append(ans)
%o A373082 print(out)
%Y A373082 Cf. A014550.
%K A373082 nonn,base
%O A373082 0,13
%A A373082 _James S. DeArmon_, May 22 2024