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.

A322795 Number of integers k, 0 <= k <= n, such that the Damerau-Levenshtein distance between the binary representations of n and k is strictly less than the Levenshtein distance.

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, 3, 0, 4, 4, 4, 1, 4, 2, 4, 0, 0, 0, 1, 0, 2, 1, 3, 0, 4, 5, 5, 1, 5, 4, 7, 0, 8, 9, 9, 6, 8, 8, 8, 1, 8, 8, 8, 2, 8, 4, 8, 0, 0, 0, 1, 0, 2, 1, 4, 0, 4, 6, 6, 1, 5, 4, 9, 0, 8, 11, 11, 7, 10, 11, 11, 1, 10, 12, 13, 5, 13, 9, 14, 0, 16, 18, 17, 15, 16
Offset: 0

Views

Author

Pontus von Brömssen, Dec 26 2018

Keywords

Comments

a(n) = 0 if and only if n appears in A099627 or n = 0.
a(n) = A079071(n) for n <= 21, but a(22) = 3 > 2 = A079071(22).

Examples

			For n = 6, the Damerau-Levenshtein distance and the Levenshtein distance between the binary representations of n and k are equal for all k <= n except k = 5. The Levenshtein distance between 101 and 110 (5 and 6 in binary) is 2, whereas the Damerau-Levenshtein distance is 1, so a(6) = 1.
		

Crossrefs

Showing 1-3 of 3 results.