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.

A079071 Number of numbers < n whose binary representation has the same number of 0's and 1's as n does.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 1, 2, 0, 0, 0, 1, 0, 2, 1, 2, 0, 3, 3, 4, 1, 5, 2, 3, 0, 0, 0, 1, 0, 2, 1, 2, 0, 3, 3, 4, 1, 5, 2, 3, 0, 4, 6, 7, 4, 8, 5, 6, 1, 9, 7, 8, 2, 9, 3, 4, 0, 0, 0, 1, 0, 2, 1, 2, 0, 3, 3, 4, 1, 5, 2, 3, 0, 4, 6, 7, 4, 8, 5, 6, 1, 9, 7, 8, 2, 9, 3, 4, 0, 5, 10, 11, 10, 12, 11, 12
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 21 2002

Keywords

Crossrefs

Programs

  • Maple
    f:= n-> (x-> (t-> t*(t+1)/2+x[2])(x[1]+x[2]))(add(
        `if`(i=0, [1, 0], [0, 1]), i=convert(n, base, 2))):
    b:= proc(n) b(n):= b(n-1)+x^f(n) end: b(-1):=0:
    a:= n-> coeff(b(n-1), x, f(n)):
    seq(a(n), n=0..150);  # Alois P. Heinz, Feb 08 2018
  • Mathematica
    a[n_] := Count[Range[n-1], k_ /; DigitCount[n, 2] == DigitCount[k, 2]];
    Table[a[n], {n, 0, 104}] (* Jean-François Alcover, Feb 13 2018 *)