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.

A326031 Weight of the set-system with BII-number n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jul 20 2019

Keywords

Comments

A binary index of n is any position of a 1 in its reversed binary expansion. We define the set-system with BII-number n to be obtained by taking the binary indices of each binary index of n. Every finite set of finite nonempty sets of positive integers has a different BII-number. For example, 18 has reversed binary expansion (0,1,0,0,1), and since the binary indices of 2 and 5 are {2} and {1,3} respectively, it follows that the BII-number of {{2},{1,3}} is 18. The weight of a set-system is the sum of sizes of its elements (sometimes called its edges).

Examples

			The sequence of set-systems together with their BII-numbers begins:
   0: {}
   1: {{1}}
   2: {{2}}
   3: {{1},{2}}
   4: {{1,2}}
   5: {{1},{1,2}}
   6: {{2},{1,2}}
   7: {{1},{2},{1,2}}
   8: {{3}}
   9: {{1},{3}}
  10: {{2},{3}}
  11: {{1},{2},{3}}
  12: {{1,2},{3}}
  13: {{1},{1,2},{3}}
  14: {{2},{1,2},{3}}
  15: {{1},{2},{1,2},{3}}
  16: {{1,3}}
  17: {{1},{1,3}}
  18: {{2},{1,3}}
  19: {{1},{2},{1,3}}
  20: {{1,2},{1,3}}
		

Crossrefs

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Length[Join@@bpe/@bpe[n]],{n,0,100}]
  • Python
    def bin_i(n): #binary indices
        return([(i+1) for i, x in enumerate(bin(n)[2:][::-1]) if x =='1'])
    def A326031(n): return sum(i.bit_count() for i in bin_i(n)) # John Tyler Rascoe, Jun 08 2024

Formula

a(2^x + ... + 2^z) = w(x + 1) + ... + w(z + 1), where x...z are distinct nonnegative integers and w = A000120. For example, a(6) = a(2^2 + 2^1) = w(3) + w(2) = 3.