login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A056973 Number of blocks of {0,0} in the binary expansion of n. 5
0, 0, 0, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 0, 1, 0, 0, 0, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 5, 4, 3, 3, 3, 2, 2, 2, 3, 2, 1, 1, 2, 1, 1, 1, 3, 2, 1, 1, 1, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 0, 4, 3, 2, 2, 2, 1, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,8
LINKS
Jean-Paul Allouche and Jeffrey Shallit, Sums of digits and the Hurwitz zeta function, in: K. Nagasaka and E. Fouvry (eds.), Analytic Number Theory, Lecture Notes in Mathematics, Vol. 1434, Springer, Berlin, Heidelberg, 1990, pp. 19-30.
Eric Weisstein's World of Mathematics, Digit Block.
FORMULA
a(2n) = a(n) + [n is even], a(2n+1) = a(n).
G.f.: 1/(1-x) * Sum_{k>=0} t^4/((1+t)*(1+t^2)) where t=x^(2^k). - Ralf Stephan, Sep 10 2003
a(n) = A023416(n) - A033264(n). - Ralf Stephan, Sep 10 2003
Sum_{n>=1} a(n)/(n*(n+1)) = 2 - 3*log(2)/2 - Pi/4 (Allouche and Shallit, 1990). - Amiram Eldar, Jun 01 2021
MAPLE
f:= proc(n) option remember;
if n mod 4 = 0 then 1 + procname(n/2)
else procname(floor(n/2))
fi
end proc:
f(1):= 0:
map(f, [$1..200]); # Robert Israel, Sep 02 2015
MATHEMATICA
f[n_] := Count[Partition[IntegerDigits[n, 2], 2, 1], {0, 0}]; Table[f@ n, {n, 0, 102}] (* Michael De Vlieger, Sep 01 2015, after Robert G. Wilson v at A014081 *)
SequenceCount[#, {0, 0}, Overlaps->True]&/@(IntegerDigits[#, 2]&/@Range[0, 120]) (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 24 2018 *)
PROG
(Haskell)
a056973 = f 0 where
f y x = if x == 0 then y else f (y + 0 ^ (mod x 4)) $ div x 2
-- Reinhard Zumkeller, Mar 31 2015
(PARI)
a(n) = { my(x = bitor(n, n>>1));
if (x == 0, 0, 1 + logint(x, 2) - hammingweight(x)) }
vector(102, i, a(i)) \\ Gheorghe Coserea, Sep 01 2015
CROSSREFS
Cf. A107782.
Sequence in context: A183094 A324192 A108730 * A107782 A368413 A086017
KEYWORD
nonn,base
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 17 23:23 EDT 2024. Contains 371767 sequences. (Running on oeis4.)