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-3 of 3 results.

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

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 9, 0, 19, 11, 24, 0, 0, 0, 17, 0, 35, 19, 40, 0, 55, 62, 87, 23, 113, 50, 79, 0, 0, 0, 33, 0, 67, 35, 72, 0, 103, 110, 151, 39, 193, 82, 127, 0, 143, 237, 286, 173, 336, 224, 277, 47, 388, 331, 388, 102, 446, 161, 222, 0, 0, 0, 65, 0, 131, 67, 136, 0
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)+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
    bdQ[m_,n_]:=Module[{a=DigitCount[m,2,0],b=DigitCount[m,2,1], c= DigitCount[ n,2,0], d=DigitCount[ n,2,1]}, a==c&&b==d]; Table[Total[ Select[Range[n-1],bdQ[#,n]&]],{n,80}] (* Harvey P. Dale, Sep 08 2011 *)

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

Original entry on oeis.org

0, 0, 1, 0, 1, 2, 2, 0, 1, 2, 3, 3, 4, 5, 3, 0, 1, 2, 4, 3, 5, 6, 6, 4, 7, 8, 7, 9, 8, 9, 4, 0, 1, 2, 5, 3, 6, 7, 10, 4, 8, 9, 11, 10, 12, 13, 10, 5, 11, 12, 14, 13, 15, 16, 11, 14, 17, 18, 12, 19, 13, 14, 5, 0, 1, 2, 6, 3, 7, 8, 15, 4, 9, 10, 16, 11, 17, 18, 20, 5, 12, 13, 19, 14, 20, 21, 21, 15
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 21 2002

Keywords

Examples

			n = 12 -> '1100': A023416(12) = 2 therefore a(12) = #{4 ->'100', 9 ->'1001', 10 ->'1010'} = 3.
n = 13 -> '1101': A023416(13) = 1 therefore a(13) = #{2 ->'10', 5 ->'101', 6 ->'110', 11 ->'1011'} = 4.
		

Crossrefs

Programs

Formula

a(n) = #{m : m < n and A023416(m) = A023416(n)}.
a(2^k - 1) = k - 1; a(2^k) = 0; a(2^k + 1) = 1.

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

Original entry on oeis.org

0, 0, 1, 0, 3, 3, 8, 0, 7, 14, 23, 7, 33, 18, 31, 0, 15, 45, 62, 45, 80, 64, 85, 15, 100, 107, 132, 38, 158, 65, 94, 0, 31, 124, 157, 186, 191, 221, 258, 124, 227, 296, 337, 163, 379, 206, 251, 31, 267, 423, 472, 297, 522, 348, 401, 78, 574, 455, 512, 133, 570, 192, 253, 0, 63
Offset: 0

Views

Author

Reinhard Zumkeller, Dec 21 2002

Keywords

Crossrefs

Programs

  • Maple
    f:= n-> add(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
    a[n_] := Module[{dc = DigitCount[n, 2, 1]}, Select[Range[n-1], DigitCount[#, 2, 1] == dc&] // Total];
    a /@ Range[0, 100] (* Jean-François Alcover, Nov 07 2020 *)
  • PARI
    a(n) = my(s=hammingweight(n)); sum(k=1, n-1, if (s==hammingweight(k), k)); \\ Michel Marcus, Nov 07 2020
Showing 1-3 of 3 results.