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 16 results. Next

A124767 Number of level runs for compositions in standard order.

Original entry on oeis.org

0, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 3, 2, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 2, 3, 2, 3, 2, 1, 1, 2, 2, 2, 1, 3, 3, 2, 2, 3, 1, 2, 3, 4, 3, 2, 2, 3, 3, 3, 3, 3, 4, 3, 2, 3, 2, 3, 2, 3, 2, 1, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 4, 3, 2, 2, 3, 3, 3, 2, 2, 3, 2, 3, 4, 3, 4, 3, 4, 3, 2, 2, 3, 3, 3, 2, 4, 4, 3, 3
Offset: 0

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
For n > 0, a(n) is one more than the number of adjacent unequal terms in the n-th composition in standard order. Also the number of runs in the same composition. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the level runs are 2; 1,1; so a(11) = 2.
The table starts:
  0
  1
  1 1
  1 2 2 1
  1 2 1 2 2 3 2 1
  1 2 2 2 2 2 3 2 2 3 2 3 2 3 2 1
  1 2 2 2 1 3 3 2 2 3 1 2 3 4 3 2 2 3 3 3 3 3 4 3 2 3 2 3 2 3 2 1
The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1) with runs ((3),(2),(1),(2,2),(1),(2),(5),(1,1,1)), so a(1234567) = 8. - _Gus Wiseman_, Apr 08 2020
		

Crossrefs

Row-lengths are A011782.
Compositions counted by number of runs are A238279 or A333755.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767 (this sequence).
- Weakly increasing compositions are A225620.
- Strict compositions A233564.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Run-lengths are A333769 (triangle).

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Split[stc[n]]],{n,0,100}] (* Gus Wiseman, Apr 17 2020 *)

Formula

a(0) = 0, a(n) = 1 + Sum_{1<=i=1 0.
For n > 0, a(n) = A333382(n) + 1. - Gus Wiseman, Apr 08 2020

A353402 Numbers k such that the k-th composition in standard order has its own run-lengths as a subsequence (not necessarily consecutive).

Original entry on oeis.org

0, 1, 10, 21, 26, 43, 53, 58, 107, 117, 174, 186, 292, 314, 346, 348, 349, 373, 430, 442, 570, 585, 586, 629, 676, 693, 696, 697, 698, 699, 804, 826, 858, 860, 861, 885, 954, 1082, 1141, 1173, 1210, 1338, 1353, 1387, 1392, 1393, 1394, 1396, 1397, 1398, 1466
Offset: 0

Views

Author

Gus Wiseman, May 15 2022

Keywords

Comments

First differs from A353432 (the consecutive case) in having 0 and 53.
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 initial terms, their binary expansions, and the corresponding standard compositions:
    0:          0  ()
    1:          1  (1)
   10:       1010  (2,2)
   21:      10101  (2,2,1)
   26:      11010  (1,2,2)
   43:     101011  (2,2,1,1)
   53:     110101  (1,2,2,1)
   58:     111010  (1,1,2,2)
  107:    1101011  (1,2,2,1,1)
  117:    1110101  (1,1,2,2,1)
  174:   10101110  (2,2,1,1,2)
  186:   10111010  (2,1,1,2,2)
  292:  100100100  (3,3,3)
  314:  100111010  (3,1,1,2,2)
  346:  101011010  (2,2,1,2,2)
  348:  101011100  (2,2,1,1,3)
  349:  101011101  (2,2,1,1,2,1)
  373:  101110101  (2,1,1,2,2,1)
  430:  110101110  (1,2,2,1,1,2)
  442:  110111010  (1,2,1,1,2,2)
		

Crossrefs

The version for partitions is A325755, counted by A325702.
These compositions are counted by A353390.
The recursive version is A353431, counted by A353391.
The consecutive case is A353432, counted by A353392.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, reverse A228351.
A333769 lists run-lengths of compositions in standard order.
Words with all distinct run-lengths: A032020, A044813, A098859, A130091, A329739, A351017.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767, distinct A351014.
- Subsequences are counted by A334299, consecutive A124770/A124771.
- Runs-resistance is A333628.
Classes of standard compositions:
- Partitions are A114994, strict A333255, rev A225620, strict rev A333256.
- Runs are A272919.
- Golomb rulers are A333222, counted by A169942.
- Knapsack compositions are A333223, counted by A325676.
- Anti-runs are A333489, counted by A003242.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[ Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    rosQ[y_]:=Length[y]==0||MemberQ[Subsets[y],Length/@Split[y]];
    Select[Range[0,100],rosQ[stc[#]]&]

A353431 Numbers k such that the k-th composition in standard order is empty, a singleton, or has its own run-lengths as a subsequence (not necessarily consecutive) that is already counted.

Original entry on oeis.org

0, 1, 2, 4, 8, 10, 16, 32, 43, 58, 64, 128, 256, 292, 349, 442, 512, 586, 676, 697, 826, 1024, 1210, 1338, 1393, 1394, 1396, 1594, 2048, 2186, 2234, 2618, 2696, 2785, 2786, 2792, 3130, 4096, 4282, 4410, 4666, 5178, 5569, 5570, 5572, 5576, 5584, 6202, 8192
Offset: 1

Views

Author

Gus Wiseman, May 16 2022

Keywords

Comments

First differs from A353696 (the consecutive version) in having 22318, corresponding to the binary word 101011100101110 and standard composition (2,2,1,1,3,2,1,1,2), whose run-lengths (2,2,1,1,2,1) are subsequence but not a consecutive subsequence.
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 initial terms, their binary expansions, and the corresponding standard compositions:
     0:           0  ()
     1:           1  (1)
     2:          10  (2)
     4:         100  (3)
     8:        1000  (4)
    10:        1010  (2,2)
    16:       10000  (5)
    32:      100000  (6)
    43:      101011  (2,2,1,1)
    58:      111010  (1,1,2,2)
    64:     1000000  (7)
   128:    10000000  (8)
   256:   100000000  (9)
   292:   100100100  (3,3,3)
   349:   101011101  (2,2,1,1,2,1)
   442:   110111010  (1,2,1,1,2,2)
   512:  1000000000  (10)
   586:  1001001010  (3,3,2,2)
   676:  1010100100  (2,2,3,3)
   697:  1010111001  (2,2,1,1,3,1)
		

Crossrefs

The non-recursive version for partitions is A325755, counted by A325702.
These compositions are counted by A353391.
The version for partitions A353393, counted by A353426, w/o primes A353389.
The non-recursive version is A353402, counted by A353390.
The non-recursive consecutive case is A353432, counted by A353392.
The consecutive case is A353696, counted by A353430.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, rev A228351, run-lens A333769.
A329738 counts uniform compositions, partitions A047966.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767, distinct A351014.
- Subsequences are counted by A334299, contiguous A124770/A124771.
- Runs-resistance is A333628.
Classes of standard compositions:
- Partitions are A114994, multisets A225620, strict A333255, sets A333256.
- Constant compositions are A272919, counted by A000005.
- Golomb rulers are A333222, counted by A169942.
- Knapsack compositions are A333223, counted by A325676.
- Anti-runs are A333489, counted by A003242.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    rorQ[y_]:=Length[y]<=1||MemberQ[Subsets[y],Length/@Split[y]]&& rorQ[Length/@Split[y]];
    Select[Range[0,100],rorQ[stc[#]]&]

A353432 Numbers k such that the k-th composition in standard order has its own run-lengths as a consecutive subsequence.

Original entry on oeis.org

0, 1, 10, 21, 26, 43, 58, 107, 117, 174, 186, 292, 314, 346, 348, 349, 373, 430, 442, 570, 585, 586, 629, 676, 696, 697, 804, 826, 860, 861, 885, 1082, 1141, 1173, 1210, 1338, 1387, 1392, 1393, 1394, 1396, 1594, 1653, 1700, 1720, 1721, 1882, 2106, 2165, 2186
Offset: 1

Views

Author

Gus Wiseman, May 16 2022

Keywords

Comments

First differs from A353402 (the non-consecutive version) in lacking 53.
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 initial terms, their binary expansions, and the corresponding standard compositions:
     0:          0  ()
     1:          1  (1)
    10:       1010  (2,2)
    21:      10101  (2,2,1)
    26:      11010  (1,2,2)
    43:     101011  (2,2,1,1)
    58:     111010  (1,1,2,2)
   107:    1101011  (1,2,2,1,1)
   117:    1110101  (1,1,2,2,1)
   174:   10101110  (2,2,1,1,2)
   186:   10111010  (2,1,1,2,2)
   292:  100100100  (3,3,3)
   314:  100111010  (3,1,1,2,2)
   346:  101011010  (2,2,1,2,2)
   348:  101011100  (2,2,1,1,3)
   349:  101011101  (2,2,1,1,2,1)
   373:  101110101  (2,1,1,2,2,1)
   430:  110101110  (1,2,2,1,1,2)
   442:  110111010  (1,2,1,1,2,2)
		

Crossrefs

These compositions are counted by A353392.
This is the consecutive case of A353402, counted by A353390.
The non-consecutive recursive version is A353431, counted by A353391.
The recursive version is A353696, counted by A353430.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, rev A228351, run-lens A333769.
A329738 counts uniform compositions, partitions A047966.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767, distinct A351014.
- Subsequences are counted by A334299, contiguous A124770/A124771.
- Runs-resistance is A333628.
Classes of standard compositions:
- Partitions are A114994, strict A333255, rev A225620, strict rev A333256.
- Runs are A272919, counted by A000005.
- Golomb rulers are A333222, counted by A169942.
- Anti-runs are A333489, counted by A003242.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    rorQ[y_]:=Length[y]==0||MemberQ[Join@@Table[Take[y,{i,j}],{i,Length[y]},{j,i,Length[y]}],Length/@Split[y]];
    Select[Range[0,10000],rorQ[stc[#]]&]

A337564 Number of sequences of length 2*n covering an initial interval of positive integers and splitting into n maximal runs.

Original entry on oeis.org

1, 1, 6, 80, 1540, 38808, 1206744, 44595408, 1908389340, 92780281880, 5050066185736, 304196411024688, 20087958167374552, 1442953024024996400, 112007566256683719600, 9342904053303870936480, 833388624898522799682780, 79159669418651567937733080
Offset: 0

Views

Author

Gus Wiseman, Sep 03 2020

Keywords

Comments

Sequences covering an initial interval of positive integers are counted by A000670 and ranked by A333217.

Examples

			The a(0) = 1 through a(2) = 6 sequences:
  ()  (1,1)  (1,1,1,2)
             (1,1,2,2)
             (1,2,2,2)
             (2,1,1,1)
             (2,2,1,1)
             (2,2,2,1)
The a(3) = 80 sequences:
  212222  111121  122233  333112  211133
  221222  111211  133222  333211  233111
  222122  112111  222133  112233  331112
  222212  121111  222331  113322  332111
  122221  123333  331222  221133  111223
  211222  133332  332221  223311  111322
  221122  213333  122223  331122  221113
  222112  233331  132222  332211  223111
  112221  333312  222213  112223  311122
  122211  333321  222231  113222  322111
  211122  122333  312222  222113  111123
  221112  133322  322221  222311  111132
  111221  221333  112333  311222  211113
  112211  223331  113332  322211  231111
  122111  333122  211333  111233  311112
  211112  333221  233311  111332  321111
		

Crossrefs

A335461 has this as main diagonal n = 2*k.
A336108 is the version for compositions.
A337504 is the version for compositions and anti-runs.
A337505 is the version for anti-runs.
A000670 counts sequences covering an initial interval.
A005649 counts anti-runs covering an initial interval.
A124767 counts maximal runs in standard compositions.
A333769 gives run lengths in standard compositions.
A337504 counts compositions of 2*n with n maximal anti-runs.
A337565 gives anti-run lengths in standard compositions.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[2*n],Length[Split[#]]==n&]],{n,0,3}]
  • PARI
    \\ here b(n) is A005649.
    b(n) = {sum(k=0, n, stirling(n,k,2)*(k + 1)!)}
    a(n) = {if(n==0, 1, b(n-1)*binomial(2*n-1,n-1))} \\ Andrew Howroyd, Dec 31 2020

Formula

a(n) = A005649(n-1)*binomial(2*n-1,n-1) = A005649(n-1)*A001700(n-1) for n > 0. - Andrew Howroyd, Dec 31 2020

Extensions

Terms a(5) and beyond from Andrew Howroyd, Dec 31 2020

A353427 Numbers k such that the k-th composition in standard order has all run-lengths > 1.

Original entry on oeis.org

0, 3, 7, 10, 15, 31, 36, 42, 43, 58, 63, 87, 122, 127, 136, 147, 170, 171, 175, 228, 234, 235, 250, 255, 292, 295, 343, 351, 471, 484, 490, 491, 506, 511, 528, 547, 586, 591, 676, 682, 683, 687, 698, 703, 904, 915, 938, 939, 943, 983, 996, 1002, 1003, 1018
Offset: 1

Views

Author

Gus Wiseman, May 16 2022

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 terms and corresponding compositions begin:
     0: ()
     3: (1,1)
     7: (1,1,1)
    10: (2,2)
    15: (1,1,1,1)
    31: (1,1,1,1,1)
    36: (3,3)
    42: (2,2,2)
    43: (2,2,1,1)
    58: (1,1,2,2)
    63: (1,1,1,1,1,1)
    87: (2,2,1,1,1)
   122: (1,1,1,2,2)
   127: (1,1,1,1,1,1,1)
		

Crossrefs

The version for partitions is A001694, counted by A007690.
The version for parts instead of lengths is A022340, counted by A212804.
These compositions are counted by A114901.
A subset of A348612 (counted by A261983).
The case of all run-lengths = 2 is A351011.
The case of all run-lengths > 2 is counted by A353400.
A005811 counts runs in binary expansion.
A011782 counts compositions.
A066099 lists compositions in standard order, reverse A228351.
Statistics of standard compositions:
- Length is A000120, sum A070939.
- Runs are counted by A124767.
- Runs-resistance is A333628.
- Run-lengths are A333769.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!MemberQ[Length/@Split[stc[#]],1]&]

A337505 Number of sequences of length 2*n covering an initial interval of positive integers and splitting into n maximal anti-runs.

Original entry on oeis.org

1, 2, 24, 440, 10780, 329112, 12006456, 508903824, 24559486380, 1328964785720, 79670488601704, 5240336913228144, 375167786246499064, 29038998659140223600, 2416268289647552828400, 215068032231876851531040, 20389611819955706893052460, 2051184695261785540782403320
Offset: 0

Views

Author

Gus Wiseman, Sep 05 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts.

Examples

			The a(2) = 24 sequences:
  (2,1,2,2)  (1,2,3,3)  (1,2,2,3)  (1,1,2,3)
  (2,2,1,2)  (1,3,3,2)  (1,3,2,2)  (1,1,3,2)
  (1,2,2,1)  (2,1,3,3)  (2,2,1,3)  (2,1,1,3)
  (2,1,1,2)  (2,3,3,1)  (2,2,3,1)  (2,3,1,1)
  (1,1,2,1)  (3,3,1,2)  (3,1,2,2)  (3,1,1,2)
  (1,2,1,1)  (3,3,2,1)  (3,2,2,1)  (3,2,1,1)
		

Crossrefs

A336108 is the version for compositions and runs.
A337504 is the version for compositions.
A337506 has this as main diagonal n = 2*k.
A337564 is the version for runs.
A000670 counts sequences covering an initial interval.
A003242 counts anti-run compositions.
A005649 counts anti-runs covering an initial interval.
A124767 counts maximal runs in standard compositions.
A333381 counts maximal anti-runs in standard compositions.
A333769 gives run-lengths in standard compositions.
A337565 gives anti-run lengths in standard compositions.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[2*n],Length[Split[#,UnsameQ]]==n&]],{n,0,3}]
  • PARI
    \\ here b(n) is A005649.
    b(n) = {sum(k=0, n, stirling(n,k,2)*(k + 1)!)}
    a(n) = {b(n)*binomial(2*n-1,n)} \\ Andrew Howroyd, Dec 31 2020

Formula

a(n) = A005649(n)*binomial(2*n-1,n). - Andrew Howroyd, Dec 31 2020

Extensions

Terms a(5) and beyond from Andrew Howroyd, Dec 31 2020

A337565 Irregular triangle read by rows where row k is the sequence of maximal anti-run lengths in the k-th composition in standard order.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 3, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 3, 3, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 1, 3, 4, 2, 2, 2, 1, 1, 1, 2, 3, 3
Offset: 0

Views

Author

Gus Wiseman, Sep 07 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts.
A composition of n is a finite sequence of positive integers summing to n. 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 first column below lists various selected n; the second column gives the corresponding composition; the third column gives the corresponding row of the triangle, i.e., the anti-run lengths.
    1:           (1) -> (1)
    3:         (1,1) -> (1,1)
    5:         (2,1) -> (2)
    7:       (1,1,1) -> (1,1,1)
   11:       (2,1,1) -> (2,1)
   13:       (1,2,1) -> (3)
   14:       (1,1,2) -> (1,2)
   15:     (1,1,1,1) -> (1,1,1,1)
   23:     (2,1,1,1) -> (2,1,1)
   27:     (1,2,1,1) -> (3,1)
   29:     (1,1,2,1) -> (1,3)
   30:     (1,1,1,2) -> (1,1,2)
   31:   (1,1,1,1,1) -> (1,1,1,1,1)
   43:     (2,2,1,1) -> (1,2,1)
   45:     (2,1,2,1) -> (4)
   46:     (2,1,1,2) -> (2,2)
   47:   (2,1,1,1,1) -> (2,1,1,1)
   55:   (1,2,1,1,1) -> (3,1,1)
   59:   (1,1,2,1,1) -> (1,3,1)
   61:   (1,1,1,2,1) -> (1,1,3)
   62:   (1,1,1,1,2) -> (1,1,1,2)
   63: (1,1,1,1,1,1) -> (1,1,1,1,1,1)
For example, the 119th composition is (1,1,2,1,1,1), with maximal anti-runs ((1),(1,2,1),(1),(1)), so row 119 is (1,3,1,1).
		

Crossrefs

A000120 gives row sums.
A333381 gives row lengths.
A333769 is the version for runs.
A003242 counts anti-run compositions.
A011782 counts compositions.
A106351 counts anti-run compositions by length.
A329744 is a triangle counting compositions by runs-resistance.
A333755 counts compositions by number of runs.
All of the following pertain to compositions in standard order (A066099):
- Sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Patterns are A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Combinatory separations are A334030.

Programs

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

A335461 Triangle read by rows where T(n,k) is the number of patterns of length n with k runs.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 4, 8, 0, 1, 6, 24, 44, 0, 1, 8, 48, 176, 308, 0, 1, 10, 80, 440, 1540, 2612, 0, 1, 12, 120, 880, 4620, 15672, 25988, 0, 1, 14, 168, 1540, 10780, 54852, 181916, 296564, 0, 1, 16, 224, 2464, 21560, 146272, 727664, 2372512, 3816548
Offset: 0

Views

Author

Gus Wiseman, Jul 03 2020

Keywords

Comments

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.

Examples

			Triangle begins:
     1
     0     1
     0     1     2
     0     1     4     8
     0     1     6    24    44
     0     1     8    48   176   308
     0     1    10    80   440  1540  2612
     0     1    12   120   880  4620 15672 25988
Row n = 3 counts the following patterns:
  (1,1,1)  (1,1,2)  (1,2,1)
           (1,2,2)  (1,2,3)
           (2,1,1)  (1,3,2)
           (2,2,1)  (2,1,2)
                    (2,1,3)
                    (2,3,1)
                    (3,1,2)
                    (3,2,1)
		

Crossrefs

Row sums are A000670.
Column n = k is A005649 (anti-run patterns).
Central coefficients are A337564.
The version for compositions is A333755.
Runs of standard compositions are counted by A124767.
Run-lengths of standard compositions are A333769.

Programs

  • Mathematica
    allnorm[n_]:=If[n<=0,{{}},Function[s,Array[Count[s,y_/;y<=#]+1&,n]]/@Subsets[Range[n-1]+1]];
    Table[Length[Select[Join@@Permutations/@allnorm[n],Length[Split[#]]==k&]],{n,0,5},{k,0,n}]
  • PARI
    \\ here b(n) is A005649.
    b(n) = {sum(k=0, n, stirling(n,k,2)*(k + 1)!)}
    T(n,k)=if(n==0, k==0, b(k-1)*binomial(n-1,k-1)) \\ Andrew Howroyd, Dec 31 2020

Formula

T(n,k) = A005649(k-1) * binomial(n-1,k-1) for k > 0. - Andrew Howroyd, Dec 31 2020

A336108 Number of compositions of 2*n with n maximal runs.

Original entry on oeis.org

1, 2, 4, 14, 36, 99, 274, 813, 2278, 6692, 19206, 56687, 164416, 486052, 1422654, 4214023, 12408476, 36825663, 108926976, 323856358, 961177042, 2862551860, 8518115200, 25407468667, 75763113682, 226297498429, 675951314988, 2021528322571, 6046881759308, 18104307275968, 54219605813884
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2020

Keywords

Examples

			The a(0) = 1 through a(3) = 14 compositions:
  ()  (2)    (1,3)    (1,2,3)
      (1,1)  (3,1)    (1,3,2)
             (1,1,2)  (1,4,1)
             (2,1,1)  (2,1,3)
                      (2,3,1)
                      (3,1,2)
                      (3,2,1)
                      (1,1,3,1)
                      (1,2,2,1)
                      (1,3,1,1)
                      (2,1,1,2)
                      (1,1,1,2,1)
                      (1,1,2,1,1)
                      (1,2,1,1,1)
		

Crossrefs

A333755 has this as main diagonal n = 2*k.
A337504 is the version for anti-runs.
A337505 is the version for anti-run patterns.
A337564 is the version for patterns.
A003242 counts anti-run compositions.
A011782 counts compositions.
A106356 counts compositions by number of adjacent equal parts.
A124767 counts maximal runs in standard compositions.
A238343 counts compositions by descents.
A272919 ranks runs.
A333213 counts compositions by weak ascents.
A333769 gives run-lengths of standard compositions.

Programs

  • Mathematica
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[2*n],Length[Split[#]]==n&]],{n,0,10}]
  • PARI
    a(n)={polcoef(polcoef((1 - y)/(1 - y - y*sum(d=1, 2*n, (1-y)^d*x^d/(1 - x^d) + O(x^(2*n+1)))),  2*n, x), n, y)} \\ Andrew Howroyd, Feb 02 2021

Formula

a(n) = A333755(2*n,n).
a(n) = [x^(2*n)*y^n] (1 - y)/(1 - y - y*Sum_{d>=1} (1-y)^d*x^d/(1 - x^d)). - Andrew Howroyd, Feb 02 2021

Extensions

Terms a(11) and beyond from Andrew Howroyd, Feb 02 2021
Showing 1-10 of 16 results. Next