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.

A334300 Number of distinct nonempty subsequences (not necessarily contiguous) in the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 01 2020

Keywords

Comments

Looking only at contiguous subsequences, or restrictions to a subinterval, gives A124770.
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Triangle begins:
  1
  1 2
  1 3 3 3
  1 3 2 5 3 6 5 4
  1 3 3 5 3 5 6 7 3 6 5 9 5 9 7 5
If the k-th composition in standard order is c, then we say that the STC-number of c is k. The n-th column below lists the STC-numbers of the nonempty subsequences of the composition with STC-number n:
  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
        1     2  2  3     4   2   5   4   6   6   7
              1  1  1     1       3   1   5   3   3
                                  2       3   2   1
                                  1       2   1
                                          1
		

Crossrefs

Row lengths are A011782.
Looking only at contiguous subsequences gives A124770.
The contiguous case with empty subsequences allowed is A124771.
Allowing empty subsequences gives A334299.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.
Contiguous positive subsequence-sums are counted by A333224.
Contiguous subsequence-sums are counted by A333257.
Subsequence-sums are counted by A334968.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Rest[Subsets[stc[n]]]]],{n,0,100}]
  • Python
    from itertools import combinations
    def comp(n):
        # see A357625
        return
    def A334300(n):
        A,C = set(),comp(n)
        c = range(len(C))
        for j in c:
            for k in combinations(c, j):
                A.add(tuple(C[i] for i in k))
        return len(A) # John Tyler Rascoe, Mar 12 2025

Formula

a(n) = A334299(n) - 1.