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-10 of 26 results. Next

A335456 Number of normal patterns matched by compositions of n.

Original entry on oeis.org

1, 2, 5, 12, 32, 84, 211, 556, 1446, 3750, 9824, 25837, 67681, 178160, 468941, 1233837, 3248788, 8554709
Offset: 0

Views

Author

Gus Wiseman, Jun 16 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
We define a pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The 8 compositions of 4 together with the a(4) = 32 patterns they match:
  4:   31:   13:   22:   211:   121:   112:   1111:
-----------------------------------------------------
  ()   ()    ()    ()    ()     ()     ()     ()
  (1)  (1)   (1)   (1)   (1)    (1)    (1)    (1)
       (21)  (12)  (11)  (11)   (11)   (11)   (11)
                         (21)   (12)   (12)   (111)
                         (211)  (21)   (112)  (1111)
                                (121)
		

Crossrefs

References found in the link are not all included here.
The version for standard compositions is A335454.
The contiguous case is A335457.
The version for Heinz numbers of partitions is A335549.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A333257(n) distinct subsequence-sums.
The n-th composition has A334299(n) distinct subsequences.
Minimal patterns avoided by a standard composition are counted by A335465.

Programs

  • Mathematica
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Sum[Length[Union[mstype/@Subsets[y]]],{y,Join@@Permutations/@IntegerPartitions[n]}],{n,0,8}]

Extensions

a(14)-a(16) from Jinyuan Wang, Jun 26 2020
a(17) from John Tyler Rascoe, Mar 14 2025

A335465 Number of minimal normal patterns avoided by the n-th composition in standard order (A066099).

Original entry on oeis.org

1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 12, 4, 3, 3, 3, 3, 4, 3, 4, 12, 4, 3, 12, 4, 12, 4, 12, 4, 3, 3, 3, 3, 4, 3, 3, 6, 4, 3, 6, 3, 3, 6, 10, 10, 4, 3, 12, 6, 12, 3, 10, 10, 12, 4, 12, 3, 12, 4, 12, 4, 3, 3, 3, 3, 4, 3, 3, 6
Offset: 0

Views

Author

Gus Wiseman, Jun 20 2020

Keywords

Comments

These patterns comprise the basis of the class of patterns generated by this composition.
We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).
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

			The bases of classes generated by (), (1), (2,1,1), (3,1,2), (2,1,2,1), and (1,2,1), corresponding to n = 0, 1, 11, 38, 45, 13, are the respective columns below.
  (1)  (1,1)  (1,2)    (1,1)    (1,1,1)    (1,1,1)
       (1,2)  (1,1,1)  (1,2,3)  (1,1,2)    (1,1,2)
       (2,1)  (2,2,1)  (1,3,2)  (1,2,2)    (1,2,2)
              (3,2,1)  (2,1,3)  (1,2,3)    (1,2,3)
                       (2,3,1)  (1,3,2)    (1,3,2)
                       (3,2,1)  (2,1,3)    (2,1,1)
                                (2,3,1)    (2,1,2)
                                (3,1,2)    (2,1,3)
                                (3,2,1)    (2,2,1)
                                (2,2,1,1)  (2,3,1)
                                           (3,1,2)
                                           (3,2,1)
		

Crossrefs

Patterns matched by standard compositions are counted by A335454.
Patterns matched by compositions of n are counted by A335456(n).
The version for Heinz numbers of partitions is A335550.
Patterns are counted by A000670 and ranked by A333217.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A334299(n) distinct subsequences.

A335454 Number of normal patterns matched by the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 14 2020

Keywords

Comments

We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).
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

			The a(n) patterns for n = 0, 1, 3, 7, 11, 13, 23, 83, 27, 45:
  0:  1:   11:   111:   211:   121:   2111:   2311:   1211:   2121:
---------------------------------------------------------------------
  ()  ()   ()    ()     ()     ()     ()      ()      ()      ()
      (1)  (1)   (1)    (1)    (1)    (1)     (1)     (1)     (1)
           (11)  (11)   (11)   (11)   (11)    (11)    (11)    (11)
                 (111)  (21)   (12)   (21)    (12)    (12)    (12)
                        (211)  (21)   (111)   (21)    (21)    (21)
                               (121)  (211)   (211)   (111)   (121)
                                      (2111)  (231)   (121)   (211)
                                              (2311)  (211)   (212)
                                                      (1211)  (221)
                                                              (2121)
		

Crossrefs

References found in the links are not all included here.
Summing over indices with binary length n gives A335456(n).
The contiguous case is A335458.
The version for Heinz numbers of partitions is A335549.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A333257(n) distinct subsequence-sums.
The n-th composition has A334299(n) distinct subsequences.
Minimal avoided patterns are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Length[Union[mstype/@Subsets[stc[n]]]],{n,0,30}]
  • Python
    from itertools import combinations
    def comp(n):
        # see A357625
        return
    def A335465(n):
        A,B,C = set(),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))
        for i in A:
            D = {v: rank + 1 for rank, v in enumerate(sorted(set(i)))}
            B.add(tuple(D[v] for v in i))
        return len(B)+1 # John Tyler Rascoe, Mar 12 2025

A333224 Number of distinct positive consecutive subsequence-sums of the k-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

The k-th composition in standard order (row k of 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.

Examples

			The composition (4,3,1,2) has positive subsequence-sums 1, 2, 3, 4, 6, 7, 8, 10, so a(550) = 8.
		

Crossrefs

Dominated by A124770.
Compositions where every subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222. The case of partitions is counted by A325768 and ranked by A325779.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and A325592 and ranked by A299702.
Strict knapsack partitions are counted by A275972 and ranked by A059519 and A301899.
Knapsack compositions are counted by A325676 and A325687 and ranked by A333223. The case of partitions is counted by A325769 and ranked by A325778, for which the number of distinct consecutive subsequences is given by A325770.
Allowing empty subsequences gives A333257.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s__,_}:>Plus[s]]]],{n,0,100}]

Formula

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

A124771 Number of distinct subsequences for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
From Vladimir Shevelev, Dec 18 2013: (Start)
Every number in binary is a concatenation of parts of the form 10...0 with k>=0 zeros. For example, 5=(10)(1), 11=(10)(1)(1), 7=(1)(1)(1). We call d>0 a c-divisor of m, if d consists of some consecutive parts of m taking from the left to the right. Note that, to d=0 corresponds an empty set of parts. So it is natural to consider 0 as a c-divisor of every m. For example, 5=(10)(1) is a divisor of 23=(10)(1)(1)(1). Analogously, 1,2,3,7,11,23 are c-divisors of 23. But 6=(1)(10) is not a c-divisor of 23.
One can prove a one-to-one correspondence between distinct subsequences for composition no. n in standard order and c-divisors of n. So, the sequence lists also numbers of c-divisors of nonnegative integers.
(End)
These are contiguous subsequences, or restrictions to a subinterval. The case for all subsequences is A334299. - Gus Wiseman, Jun 02 2020

Examples

			Composition number 11 is 2,1,1; the subsequences are (empty); 1; 2; 1,1; 2,1; 2,1,1; so a(11) = 6.
The table starts:
1
2
1 2
1 3 3 3
Let n=11=(10)(1)(1). We have the following c-divisors of 11: 0,1,2,3,5,11. Thus a(11)=6. Note, that 3=(1)(1) is not a c-divisor of 13=(1)(10)(1) since, although it contains parts of 3=(1)(1), but in non-consecutive order. The c-divisors of 13 are 0,1,2,5,6,13. So, a(13)=6.
From _Gus Wiseman_, Jun 01 2020: (Start)
The c-divisors of n are given in column n below:
  0  0  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0   0   0
     1  2  1  4  1  1  1  8  1  2   1   1   1   1   1   16  1   2
           3     2  2  3     4  10  2   4   2   2   3       8   4
                 5  6  7     9      3   12  5   3   7       17  18
                                    5       6   6   15
                                    11      13  14
(End)
		

Crossrefs

Cf. A000005, A011782 (row lengths), A066099, A114994, A233249, A233312.
Not allowing empty subsequences gives A124770.
Dominates A333257.
The case for not just contiguous subsequences is A334299.
Positions of first appearances are A335279.
Compositions where every subinterval has a different sum are A333222.
Knapsack compositions are A333223.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s___,_}:>{s}]]],{n,0,100}] (* Gus Wiseman, Jun 01 2020 *)

Formula

a(n) = A124770(n) + 1.
From Vladimir Shevelev, Dec 18 2013: (Start)
a(2^n) = 2. Note that in concatenation representations of integers in binary, numbers {2^k}, k>=0, play the role of primes. So the formula is an analog of A000005(prime(n))=2.
a(2^n-1) = n+1; for n>=2, a(2^n+1) = 4.
For c-equivalent numbers n_1 and n_2 (i.e., differed only by order of parts) we have a(n_1) = a(n_2). For example, a(24)=a(17)=4. If the canonical representation of n is n=(1)^k_1[*](10)^k_2[*](100)^k_3[*]... , where [*] denotes operation of concatenation (cf. A233569), then a(n)<=(k_1+1)*(k_2+1)*...
(End)

A333257 Number of distinct consecutive subsequence-sums of the k-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 20 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.

Examples

			The ninth composition in standard order is (3,1), which has consecutive subsequences (), (1), (3), (3,1), with sums 0, 1, 3, 4, so a(9) = 4.
		

Crossrefs

Dominated by A124771.
Compositions where every subinterval has a different sum are counted by A169942 and A325677 and ranked by A333222, while the case of partitions is counted by A325768 and ranked by A325779.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and ranked by A299702.
Knapsack compositions are counted by A325676 and A325687 and ranked by A333223.
The version for Heinz numbers of partitions is A325770.
Not allowing empty subsequences gives A333224.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[ReplaceList[stc[n],{_,s___,_}:>Plus[s]]]],{n,0,100}]

Formula

a(n) = A333224(n) + 1.

A335458 Number of normal patterns contiguously matched by the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 21 2020

Keywords

Comments

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.
We define a (normal) pattern to be a finite sequence covering an initial interval of positive integers. Patterns are counted by A000670 and ranked by A333217. A sequence S is said to match a pattern P if there is a not necessarily contiguous subsequence of S whose parts have the same relative order as P. For example, (3,1,1,3) matches (1,1,2), (2,1,1), and (2,1,2), but avoids (1,2,1), (1,2,2), and (2,2,1).

Examples

			The a(180) = 7 patterns are: (), (1), (1,2), (2,1), (1,2,3), (2,1,2), (2,1,2,3).
		

Crossrefs

The non-contiguous version is A335454.
Summing over indices with binary length n gives A335457(n).
The nonempty version is A335474.
Patterns are counted by A000670 and ranked by A333217.
The n-th composition has A124771(n) distinct consecutive subsequences.
Knapsack compositions are counted by A325676 and ranked by A333223.
The n-th composition has A333257(n) distinct subsequence-sums.
The n-th composition has A334299(n) distinct subsequences.
Minimal avoided patterns are counted by A335465.

Programs

  • Mathematica
    stc[n_]:=Reverse[Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]];
    mstype[q_]:=q/.Table[Union[q][[i]]->i,{i,Length[Union[q]]}];
    Table[Length[Union[mstype/@ReplaceList[stc[n],{_,s___,_}:>{s}]]],{n,0,30}]

Formula

a(n) = A335474(n) + 1.

A334299 Number of distinct subsequences (not necessarily contiguous) of compositions in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 01 2020

Keywords

Comments

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
  2
  2 3
  2 4 4 4
  2 4 3 6 4 7 6 5
  2 4 4 6 4 6 7 8 4 7 6 10 6 10 8 6
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 subsequences of the composition with STC-number n:
  0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
     0  0  1  0  2  2  3  0  4   2   5   4   6   6   7
           0     1  1  1     1   0   3   1   5   3   3
                 0  0  0     0       2   0   3   2   1
                                     1       2   1   0
                                     0       1   0
                                             0
		

Crossrefs

Row lengths are A011782.
Looking only at contiguous subsequences gives A124771.
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.
Disallowing empty subsequences gives A334300.
Subsequence-sums are counted by A334968.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Subsets[stc[n]]]],{n,0,100}]

Formula

a(n) = A334300(n) + 1.

A333222 Numbers k such that every restriction of the k-th composition in standard order to a subinterval has a different sum.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 16, 17, 18, 20, 24, 32, 33, 34, 40, 41, 48, 50, 64, 65, 66, 68, 69, 70, 72, 80, 81, 88, 96, 98, 104, 128, 129, 130, 132, 133, 134, 144, 145, 160, 161, 176, 192, 194, 196, 208, 256, 257, 258, 260, 261, 262, 264, 265, 268, 272, 274
Offset: 1

Views

Author

Gus Wiseman, Mar 17 2020

Keywords

Comments

Also numbers whose binary indices together with 0 define a Golomb ruler.
The k-th composition in standard order (row k of 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.

Examples

			The list of terms together with the corresponding compositions begins:
    0: ()        41: (2,3,1)    130: (6,2)      262: (6,1,2)
    1: (1)       48: (1,5)      132: (5,3)      264: (5,4)
    2: (2)       50: (1,3,2)    133: (5,2,1)    265: (5,3,1)
    4: (3)       64: (7)        134: (5,1,2)    268: (5,1,3)
    5: (2,1)     65: (6,1)      144: (3,5)      272: (4,5)
    6: (1,2)     66: (5,2)      145: (3,4,1)    274: (4,3,2)
    8: (4)       68: (4,3)      160: (2,6)      276: (4,2,3)
    9: (3,1)     69: (4,2,1)    161: (2,5,1)    288: (3,6)
   12: (1,3)     70: (4,1,2)    176: (2,1,5)    289: (3,5,1)
   16: (5)       72: (3,4)      192: (1,7)      290: (3,4,2)
   17: (4,1)     80: (2,5)      194: (1,5,2)    296: (3,2,4)
   18: (3,2)     81: (2,4,1)    196: (1,4,3)    304: (3,1,5)
   20: (2,3)     88: (2,1,4)    208: (1,2,5)    320: (2,7)
   24: (1,4)     96: (1,6)      256: (9)        321: (2,6,1)
   32: (6)       98: (1,4,2)    257: (8,1)      324: (2,4,3)
   33: (5,1)    104: (1,2,4)    258: (7,2)      328: (2,3,4)
   34: (4,2)    128: (8)        260: (6,3)      352: (2,1,6)
   40: (2,4)    129: (7,1)      261: (6,2,1)    384: (1,8)
		

Crossrefs

A subset of A233564.
Also a subset of A333223.
These compositions are counted by A169942 and A325677.
The number of distinct nonzero subsequence-sums is A333224.
The number of distinct subsequence-sums is A333257.
Lengths of optimal Golomb rulers are A003022.
Inequivalent optimal Golomb rulers are counted by A036501.
Complete rulers are A103295, with perfect case A103300.
Knapsack partitions are counted by A108917, with strict case A275972.
Distinct subsequences are counted by A124770 and A124771.
Golomb subsets are counted by A143823.
Heinz numbers of knapsack partitions are A299702.
Knapsack compositions are counted by A325676.
Maximal Golomb rulers are counted by A325683.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,300],UnsameQ@@ReplaceList[stc[#],{_,s__,_}:>Plus[s]]&]

A334968 Number of possible sums of subsequences (not necessarily contiguous) of the n-th composition in standard order (A066099).

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 02 2020

Keywords

Comments

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

			The 139th composition is (4,2,1,1), with possible sums of subsequences {0,1,2,3,4,5,6,7,8}, so a(139) = 9.
Triangle begins:
  1
  2
  2 3
  2 4 4 4
  2 4 3 5 4 5 5 5
  2 4 4 6 4 6 6 6 4 6 6 6 6 6 6 6
  2 4 4 6 3 7 7 7 4 7 4 7 7 7 7 7 4 6 7 7 7 7 7 7 6 7 7 7 7 7 7 7
		

Crossrefs

Row lengths are A011782.
Dominated by A124771 (number of contiguous subsequences).
Dominates A333257 (the contiguous case).
Dominated by A334299 (number of subsequences).
Golomb rulers are counted by A169942 and ranked by A333222.
Positive subset-sums of partitions are counted by A276024 and A299701.
Knapsack partitions are counted by A108917 and ranked by A299702
Knapsack compositions are counted by A325676 and ranked by A333223.
Contiguous subsequence-sums are counted by A333224 and ranked by A333257.
Knapsack compositions are counted by A334268 and ranked by A334967.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Union[Total/@Subsets[stc[n]]]],{n,0,100}]

Formula

a(n) = A299701(A333219(n)).
Showing 1-10 of 26 results. Next