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-6 of 6 results.

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

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

A337504 Number of compositions of 2*n with n maximal anti-runs.

Original entry on oeis.org

1, 1, 3, 8, 13, 33, 112, 286, 769, 2288, 6695, 18745, 54654, 160888, 467402, 1362378, 4016517, 11807966, 34708018, 102451390, 302870005, 895207191, 2650590597, 7859253320, 23316653154, 69231883374, 205773157904, 612021943421, 1821435719846, 5424528040529, 16165017705176
Offset: 0

Views

Author

Gus Wiseman, Sep 04 2020

Keywords

Comments

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

Examples

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

Crossrefs

A106356 has this as main diagonal n = 2*k.
A336108 is the version for runs.
A337505 is the version for patterns.
A337564 is the version for runs in patterns.
A003242 counts anti-run compositions.
A011782 counts compositions.
A124767 counts runs in standard compositions.
A238343 counts compositions by descents.
A333213 counts compositions by weak ascents.
A333381 counts anti-runs in standard compositions.
A333382 counts adjacent unequal pairs in standard compositions.
A333489 ranks anti-runs.
A333755 counts compositions by number of runs.
A333769 gives run-lengths in standard compositions.
A337565 gives anti-run lengths in standard compositions.

Programs

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

Formula

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

Extensions

Terms a(11) and beyond from Andrew Howroyd, Feb 02 2021

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-6 of 6 results.