login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A056975
Number of blocks of {0, 0, 1} in binary expansion of n.
9
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1
OFFSET
1,73
LINKS
Eric Weisstein's World of Mathematics, Digit Block
FORMULA
a(2n) = a(n), a(2n+1) = a(n) + [n congruent to 0 mod 4]. - Ralf Stephan, Aug 22 2003
MATHEMATICA
a[n_, bits_] := (idn = IntegerDigits[n, 2]; ln = Length[idn]; lb = Length[bits]; For[cnt = 0; k = 1, k <= ln - lb + 1, k++, If[idn[[k ;; k + lb - 1]] == bits, cnt++]]; cnt); Table[ a[n, {0, 0, 1}], {n, 1, 102} ] (* Jean-François Alcover, Oct 23 2012 *)
Table[SequenceCount[IntegerDigits[n, 2], {0, 0, 1}], {n, 110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 26 2019 *)
CROSSREFS
Cf. A007088 (binary expansion).
Other block counts: A014082, A056974, A056976, A056977, A056978, A056979, A056980.
Sequence in context: A278907 A037910 A162781 * A370482 A294079 A375669
KEYWORD
nonn,base,easy
STATUS
approved