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

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A139351 Let the binary expansion of n be n = Sum_{k} 2^{r_k}, let e(n) be the number of r_k's that are even, o(n) the number that are odd; sequence gives e(n). 13
0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 1, 2, 2, 3, 2, 3, 0, 1, 0, 1, 1, 2, 1, 2, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 1, 2, 2, 3, 2, 3, 1, 2, 1, 2, 2, 3, 2, 3, 2, 3, 2, 3, 3, 4, 3, 4, 2, 3, 2, 3, 3, 4, 3, 4, 1, 2, 1 (list; graph; refs; listen; history; internal format)
OFFSET

0,6

COMMENTS

e(n)+o(n) = A000120(n), the binary weight of n.

a(n) is also number of 1's and 3's in 4-ary representation of n. [From Frank Ruskey (ruskey(AT)cs.uvic.ca), May 02 2009]

LINKS

N. J. A. Sloane, Fortran program for this and related sequences

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

FORMULA

G.f.: (1/(1-z))*SUM( z^(4^m)/(1+z^(4^m)), m >= 0 ). [From Frank Ruskey (ruskey(AT)cs.uvic.ca), May 03 2009]

Recurrence relation: a(0)=0, a(4m) = a(4m+2) = a(m), a(4m+1) = a(4m+3) = 1+a(m). [From Frank Ruskey (ruskey(AT)cs.uvic.ca), May 11 2009]

a(n)=Sum_k {A030308(n,k)*A059841(k)}. - From DELEHAM Philippe, Oct 14 2011.

EXAMPLE

If n = 43 = 2^0+2^1+2^3+2^5, e(43)=1, o(43)=3.

PROG

See link for Fortran program.

(Haskell)

import Data.List (unfoldr)

a139351 = sum . map (`mod` 2) .

   unfoldr (\x -> if x == 0 then Nothing else Just (x, x `div` 4)

-- Reinhard Zumkeller, Apr 22 2011

CROSSREFS

Cf. A000120, A139352-A139355, A039004, A139370-A139373.

Sequence in context: A070088 A131851 A104886 * A125925 A036578 A077402

Adjacent sequences:  A139348 A139349 A139350 * A139352 A139353 A139354

KEYWORD

nonn

AUTHOR

Nadia Heninger (nadiah(AT)cs.princeton.edu) and N. J. A. Sloane (njas(AT)research.att.com), Jun 07 2008

EXTENSIONS

Typo in example fixed by Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Apr 22 2011

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

Content is available under The OEIS End-User License Agreement .

Last modified February 14 13:08 EST 2012. Contains 205623 sequences.