login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A033264 Number of blocks of {1,0} in the binary expansion of n. 15
0, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 2 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,10

COMMENTS

Number of i such that d(i)<d(i-1), where Sum{d(i)*2^i: i=0,1,....,m} is base 2 representation of n.

This is the base-2 down-variation sequence; see A297330. - Clark Kimberling, Jan 18 2017

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Ralf Stephan, Some divide-and-conquer sequences ...

Ralf Stephan, Table of generating functions

Eric Weisstein's World of Mathematics, Digit Block

Index entries for sequences related to binary expansion of n

FORMULA

G.f.: 1/(1-x) * sum(k>=0, t^2/(1+t)/(1+t^2), t=x^2^k). - Ralf Stephan, Sep 10 2003

a(n) = A069010(n) - (n mod 2). - Ralf Stephan, Sep 10 2003

a(4n) = a(4n+1) = a(2n), a(4n+2) = a(n)+1, a(4n+3) = a(n). - Ralf Stephan, Aug 20 2003

a(n) = A087116(n) for n > 0 since strings of 0s alternate with strings of 1s, which end in (1,0). - Jonathan Sondow, Jan 17 2016

MAPLE

f:= proc(n) option remember; local k;

k:= n mod 4;

if k = 2 then procname((n-2)/4) + 1

elif k = 3 then procname((n-3)/4)

else procname((n-k)/2)

fi

end proc:

f(1):= 0: f(0):= q:

seq(f(i), i=1..100); # Robert Israel, Aug 31 2015

MATHEMATICA

Table[Count[Partition[IntegerDigits[n, 2], 2, 1], {1, 0}], {n, 102}] (* Michael De Vlieger, Aug 31 2015, after Robert G. Wilson v at A014081 *)

Table[SequenceCount[IntegerDigits[n, 2], {1, 0}], {n, 110}] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 26 2017 *)

PROG

(Haskell)

a033264 = f 0 . a030308_row where

   f c [] = c

   f c (0 : 1 : bs) = f (c + 1) bs

   f c (_ : bs) = f c bs

-- Reinhard Zumkeller, Feb 20 2014, Jun 17 2012

(PARI)

a(n) = { hammingweight(bitand(n>>1, bitneg(n))) }; \\ Gheorghe Coserea, Aug 30 2015

CROSSREFS

Cf. A014081, A014082, A037800, A056974, A056975, A056976, A056977, A056978, A056979, A056980.

a(n) = A005811(n) - ceiling(A005811(n)/2) = A005811(n) - A069010(n).

Equals (A072219(n+1)-1)/2.

Cf. also A175047, A030308.

Essentially the same as A087116.

Sequence in context: A047988 A037818 A087116 * A258045 A239302 A256983

Adjacent sequences:  A033261 A033262 A033263 * A033265 A033266 A033267

KEYWORD

nonn,base,easy

AUTHOR

Clark Kimberling

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 22 19:36 EST 2018. Contains 299469 sequences. (Running on oeis4.)