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.

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

A337506 Triangle read by rows where T(n,k) is the number of length-n sequences covering an initial interval of positive integers with k maximal anti-runs.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 06 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts. The number of maximal anti-runs is one more than the number of adjacent equal parts.

Examples

			Triangle begins:
  1
  0      1
  0      2      1
  0      8      4      1
  0     44     24      6      1
  0    308    176     48      8      1
  0   2612   1540    440     80     10      1
  0  25988  15672   4620    880    120     12      1
  0 296564 181916  54852  10780   1540    168     14      1
Row n = 3 counts the following sequences (empty column indicated by dot):
  .  (1,2,1)  (1,1,2)  (1,1,1)
     (1,2,3)  (1,2,2)
     (1,3,2)  (2,1,1)
     (2,1,2)  (2,2,1)
     (2,1,3)
     (2,3,1)
     (3,1,2)
     (3,2,1)
		

Crossrefs

A000670 gives row sums.
A005649 gives column k = 1.
A337507 gives column k = 2.
A337505 gives the diagonal n = 2*k.
A106356 is the version for compositions.
A238130/A238279/A333755 is the version for runs in compositions.
A335461 has the reversed rows (except zeros).
A003242 counts anti-run compositions.
A124762 counts adjacent equal terms in standard compositions.
A124767 counts maximal runs in standard compositions.
A333381 counts maximal anti-runs in standard compositions.
A333382 counts adjacent unequal terms in standard compositions.
A333489 ranks anti-run compositions.
A333769 gives maximal run-lengths in standard compositions.
A337565 gives maximal 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[n],Length[Split[#,UnsameQ]]==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(n-k)*binomial(n-1,k-1)) \\ Andrew Howroyd, Dec 31 2020

Formula

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

Extensions

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

A337507 Number of length-n sequences covering an initial interval of positive integers with exactly two maximal anti-runs, or with one pair of adjacent equal parts.

Original entry on oeis.org

0, 0, 1, 4, 24, 176, 1540, 15672, 181916, 2372512, 34348932, 546674120, 9486840748, 178285201008, 3607174453844, 78177409231768, 1806934004612220, 44367502983673664, 1153334584544496676, 31643148872573831016
Offset: 0

Views

Author

Gus Wiseman, Sep 06 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts. For example, the maximal anti-runs in (3,1,1,2,2,2,1) are ((3,1),(1,2),(2),(2,1)). In general, there is one more maximal anti-run than the number of pairs of adjacent equal parts.

Examples

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

Crossrefs

A002133 is the version for runs in partitions.
A106357 is the version for compositions.
A337506 has this as column k = 2.
A000670 counts patterns.
A005649 counts anti-run patterns.
A003242 counts anti-run compositions.
A106356 counts compositions by number of maximal anti-runs.
A124762 counts adjacent equal terms in standard compositions.
A124767 counts maximal runs in standard compositions.
A238130/A238279/A333755 count maximal runs in compositions.
A333381 counts maximal anti-runs in standard compositions.
A333382 counts adjacent unequal terms in standard compositions.
A333489 ranks anti-run compositions.
A333769 gives maximal run lengths in standard compositions.
A337565 gives maximal anti-run lengths in standard compositions.

Programs

  • Mathematica
    kv=2;
    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[#,UnsameQ]]==kv&]],{n,0,6}]

Formula

a(n > 0) = (n - 1)*A005649(n - 2).
Showing 1-3 of 3 results.