cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A139353 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)*o(n).

Original entry on oeis.org

0, 0, 0, 1, 0, 0, 1, 2, 0, 1, 0, 2, 1, 2, 2, 4, 0, 0, 1, 2, 0, 0, 2, 3, 1, 2, 2, 4, 2, 3, 4, 6, 0, 1, 0, 2, 1, 2, 2, 4, 0, 2, 0, 3, 2, 4, 3, 6, 1, 2, 2, 4, 2, 3, 4, 6, 2, 4, 3, 6, 4, 6, 6, 9, 0, 0, 1, 2, 0, 0, 2, 3, 1, 2, 2, 4, 2, 3, 4, 6, 0, 0, 2, 3, 0, 0, 3, 4, 2, 3, 4, 6, 3, 4, 6, 8, 1, 2, 2
Offset: 0

Views

Author

Nadia Heninger and N. J. A. Sloane, Jun 07 2008

Keywords

Comments

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

Examples

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

Crossrefs

Programs

  • Fortran
    c See link in A139351
  • Mathematica
    e[0] = 0; e[n_] := e[n] = e[Floor[n/4]] + If[OddQ[Mod[n, 4]], 1, 0];
    o[0] = 0; o[n_] := o[n] = o[Floor[n/4]] + If[Mod[n, 4] > 1, 1, 0];
    a[n_] := e[n] * o[n]; Array[a, 100, 0] (* Amiram Eldar, Jul 18 2023 *)

Formula

a(n) = A139351(n) * A139352(n). - Amiram Eldar, Jul 18 2023