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

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A069010 Number of runs of 1's in binary representation of n. 24
0, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2, 1, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 3, 2, 2, 2, 3, 3, 3, 2, 3, 2, 2, 2, 3, 3, 3, 3, 4, 3, 3, 2, 3, 3, 3, 2, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

COMMENTS

a(n) is also the number of distinct parts in the integer partition having viabin number n. The viabin number of an integer partition is defined in the following way. Consider the southeast border of the Ferrers board of the integer partition and consider the binary number obtained by replacing each east step with 1 and each north step, except the last one, with 0. The corresponding decimal form is, by definition, the viabin number of the given integer partition. "Viabin" is coined from "via binary". For example, consider the integer partition [2,2,2,1]. The southeast border of its Ferrers board yields 10100, leading to the viabin number 20. - Emeric Deutsch, Jul 24 2017

LINKS

Tilman Piesk (terms 0..9999) & Antti Karttunen, Table of n, a(n) for n = 0..16384

Vladimir Shevelev, Two analogs of Thue-Morse sequence, arXiv:1603.04434 [math.NT], 2016.

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

Ralf Stephan, Table of generating functions

FORMULA

a(n) = ceiling[A005811(n)/2] = A005811(n)-A033264(n). If 2^k<=n<3*2^(k-1) then a(n) =a (n-2^k)+1; if 3*2^(k-1)<=n<2^(k+1) then a(n) = a(n-2^k).

a(2n) = a(n), a(2n+1) = a(n) + [n is even]. - Ralf Stephan, Aug 20 2003

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

a(n) = A000120(n) - A014081(n) = A037800(n) + 1, n>0. - Ralf Stephan, Sep 10 2003

EXAMPLE

a(11) = 2 since 11 is 1011 in binary with two runs of 1's.

a(12) = 1 since 12 is 1100 in binary with one run of 1's.

MAPLE

f:= proc(n) option remember; if n::even then procname(n/2)

elif n mod 4 = 1 then 1 + procname((n-1)/2) else  procname((n-1)/2) fi end proc:

f(0):= 0:

map(f, [$0..1000]); # Robert Israel, Sep 06 2015

MATHEMATICA

Count[Split@ IntegerDigits[#, 2], n_ /; First@ n == 1] & /@ Range[0, 120] (* Michael De Vlieger, Sep 05 2015 *)

PROG

(PARI) a(n) = (1 + (hammingweight(bitxor(n, n>>1)))) >> 1;  \\ Gheorghe Coserea, Sep 05 2015

(Scheme) (define (A069010 n) (/ (+ (A005811 n) (A000035 n)) 2)) ;; Antti Karttunen, Feb 05 2016

(Python)

def A069010(n):

    return sum(1 for d in bin(n)[2:].split('0') if len(d)) # Chai Wah Wu, Nov 04 2016

CROSSREFS

Cf. A000035, A000120, A005811, A014081, A033264, A037800.

Cf. A268411 (gives the parity of the terms).

Cf. A268412 (positions of even terms), A268415 (of odd terms).

Cf. also A227349, A246588.

Sequence in context: A122586 A079487 A229122 * A256122 A087048 A109700

Adjacent sequences:  A069007 A069008 A069009 * A069011 A069012 A069013

KEYWORD

base,easy,nonn

AUTHOR

Henry Bottomley, Apr 02 2002

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 December 15 03:08 EST 2017. Contains 296020 sequences.