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.
%I A277017 #10 Sep 26 2016 20:50:31 %S A277017 0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,0,0, %T A277017 0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,2,0,1,1,1,0,0,0,1, %U A277017 0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,1,1,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,0,2,0 %N A277017 Number of maximal runs of 1-bits (in binary expansion of n) such that the length of run >= A000040(1 + the total number of zeros to the right of that run). %C A277017 a(n) = number of 1-runs in binary expansion of n that exceed the length allotted to that run by primorial base coding used in A277022. If a(n) = 0, then n is in the range of A277022. %H A277017 Antti Karttunen, <a href="/A277017/b277017.txt">Table of n, a(n) for n = 0..8192</a> %H A277017 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a> %H A277017 <a href="/index/Pri#primorialbase">Index entries for sequences related to primorial base</a> %F A277017 a(n) = A129251(A005940(1+n)). %e A277017 For n=3, "11" in binary, the only maximal run of 1-bits is of length 2, and 2 >= prime(0+1) (where 0 is the total number of zeros to the right of it), thus a(3) = 1. %e A277017 For n=59, "111011" in binary, both the length of run "11" at the least significant end exceeds the limit (see case n=3 above), and also the length of run "111" >= prime(1 + the total number of 0's to the right of it) = prime(2) = 3, thus a(59) = 1+1 = 2. %e A277017 For n=60, "111100" in binary, the length of only run of 1's is 4, and 4 < prime(2+1) = 5, thus a(60) = 0. %o A277017 (Scheme) %o A277017 (define (A277017 n) (let loop ((e 0) (n n) (z 0) (r 0)) (cond ((zero? n) (+ e (if (>= r (A000040 (+ 1 z))) 1 0))) ((even? n) (loop (+ e (if (>= r (A000040 (+ 1 z))) 1 0)) (/ n 2) (+ 1 z) 0)) (else (loop e (/ (- n 1) 2) z (+ 1 r)))))) %Y A277017 Cf. A277018 (positions of zeros), A277019 (of nonzeros). %Y A277017 Cf. A000040, A005940, A129251, A277021, A277022. %Y A277017 Differs from similar A277007 for the first time at n=60, where a(60)=0, while A277007(60)=1. %K A277017 nonn,base %O A277017 0,60 %A A277017 _Antti Karttunen_, Sep 26 2016