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.

Showing 1-2 of 2 results.

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 *)

A079072 Sum of numbers < n having in binary representation the same number of 0's as n.

Original entry on oeis.org

0, 0, 0, 1, 0, 2, 7, 4, 0, 4, 13, 13, 23, 24, 37, 11, 0, 8, 25, 35, 43, 54, 75, 51, 63, 97, 122, 74, 148, 101, 130, 26, 0, 16, 49, 87, 83, 122, 159, 176, 119, 197, 238, 215, 280, 258, 303, 160, 159, 324, 373, 349, 423, 400, 453, 207, 475, 507, 564, 262, 622, 321, 382, 57, 0
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 21 2002

Keywords

Crossrefs

Programs

  • Maple
    f:= n-> add(1-i, i=convert(n, base, 2)):
    b:= proc(n) b(n):= b(n-1)+n*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
    snbr[n_]:=Module[{dc=DigitCount[n,2,0]},Total[Select[Range[n-1], DigitCount[ #,2,0]==dc&]]]; Array[snbr,70] (* Harvey P. Dale, May 03 2012 *)
Showing 1-2 of 2 results.