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

A008304 Triangle read by rows: T(n,k) (n>=1; 1<=k<=n) is the number of permutations of [n] in which the longest increasing run has length k.

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 16, 6, 1, 1, 69, 41, 8, 1, 1, 348, 293, 67, 10, 1, 1, 2016, 2309, 602, 99, 12, 1, 1, 13357, 19975, 5811, 1024, 137, 14, 1, 1, 99376, 189524, 60875, 11304, 1602, 181, 16, 1, 1, 822040, 1960041, 690729, 133669, 19710, 2360, 231, 18, 1, 1, 7477161
Offset: 1

Views

Author

Keywords

Comments

Row n has n terms.

Examples

			Triangle T(n,k) begins:
  1;
  1,   1;
  1,   4,   1;
  1,  16,   6,  1;
  1,  69,  41,  8,  1;
  1, 348, 293, 67, 10,  1;
  ...
T(3,2) = 4 because we have (13)2, 2(13), (23)1, 3(12), where the parentheses surround runs of length 2.
		

References

  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 261, Table 7.4.1.

Crossrefs

Row sums give A000142. Sum_{k=1..n} k*T(n,k) = A064314(n). Cf. A064315.

Programs

  • Maple
    b:= proc(u, o, t, k) option remember; `if`(t=k, (u+o)!,
          `if`(max(t, u)+o b(0, n, 0, k) -b(0, n, 0, k+1):
    seq(seq(T(n,k), k=1..n), n=1..15);  # Alois P. Heinz, Oct 16 2013
  • Mathematica
    b[u_, o_, t_, k_] := b[u, o, t, k] = If[t == k, (u + o)!, If[Max[t, u]+o < k, 0, Sum[b[u+j-1, o-j, t+1, k], {j, 1, o}] + Sum[b[u-j, o+j-1, 1, k], {j, 1, u}]]]; T[n_, k_] := b[0, n, 0, k] - b[0, n, 0, k+1]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 15}] // Flatten (* Jean-François Alcover, Jan 10 2014, translated from Alois P. Heinz's Maple code *)
    (*additional code*)
    nn=12;a[r_]:=Apply[Plus,Table[Normal[Series[y x^(r+1)/(1-Sum[y x^i,{i,1,r}]),{x,0,nn}]][[n]]/(n+r)!,{n,1,nn-r}]]/.y->-1;Map[Select[#,#>0&]&,Transpose[Prepend[Table[Drop[Range[0,nn]! CoefficientList[Series[1/(1-x-a[n+1])-1/(1-x-a[n]),{x,0,nn}],x],1],{n,1,8}],Table[1,{nn}]]]]//Grid (* Geoffrey Critzer, Feb 25 2014 *)

Formula

E.g.f. of column k: 1/Sum_{n>=0} ((k+1)*n+1-x)*x^((k+1)*n)/((k+1)*n+1)! - 1/Sum_{n>=0} (k*n+1-x)*x^(k*n)/(k*n+1)!. - Alois P. Heinz, Oct 13 2013
T(n,k) = A122843(n,k) for k > n/2. - Alois P. Heinz, Oct 17 2013

Extensions

More terms from David W. Wilson, Sep 07 2001
Better description from Emeric Deutsch, May 08 2004

A228614 Number of permutations of [n] having a shortest ascending run of length one.

Original entry on oeis.org

0, 1, 1, 5, 18, 101, 611, 4452, 36287, 333395, 3382758, 37688597, 456839351, 5989023768, 84421235807, 1273482972215, 20470309460322, 349326503482301, 6307682420743595, 120157254334350828, 2408293016265606623, 50663563124372167787, 1116225038923857181614
Offset: 0

Views

Author

Alois P. Heinz, Aug 27 2013

Keywords

Examples

			a(1) = 1: 1.
a(2) = 1: 21.
a(3) = 5: 132, 213, 231, 312, 321.
a(4) = 18: 1243, 1342, 1432, 2134, 2143, 2341, 2431, 3124, 3142, 3214, 3241, 3421, 4123, 4132, 4213, 4231, 4312, 4321.
		

Crossrefs

Column k=1 of A064315.

Programs

  • Maple
    g:= proc(u, o) option remember; `if`(u+o<2, u,
          add(b(u-i, o+i-1), i=1..u) +add(g(u+i-1, o-i), i=1..o))
        end:
    b:= proc(u, o) option remember; `if`(u+o<2, 1-o,
          u*(u+o-1)! +add(g(u+i-1, o-i), i=1..o))
        end:
    a:= n-> add(b(j-1, n-j), j=1..n):
    seq(a(n), n=0..25);
  • Mathematica
    g[u_, o_] := g[u, o] = If[u + o < 2, u,
         Sum[b[u - i, o + i - 1], {i, u}] +
         Sum[g[u + i - 1, o - i], {i, o}]];
    b[u_, o_] := b[u, o] = If[u + o < 2, 1 - o, u*(u + o - 1)! +
         Sum[g[u + i - 1, o - i], {i, o}]];
    a[n_] := Sum[b[j - 1, n - j], {j, n}];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Aug 30 2021, after Alois P. Heinz *)

Formula

a(n) = A000142(n) - A097899(n).
E.g.f.: 1/(1-x) - sqrt(3)*exp(-x/2) / (2*cos(sqrt(3)*x/2+Pi/6)).

A185652 Number of permutations of [n] having a shortest ascending run of length 2.

Original entry on oeis.org

0, 0, 1, 0, 5, 18, 89, 519, 3853, 27555, 233431, 2167152, 21596120, 232817282, 2718706924, 33814848445, 448311181346, 6319365554730, 94225534689624, 1481940898130323, 24536143182460549, 426432943716156580, 7762187693343502658, 147704506384475066381
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Examples

			a(2) = 1: 12.
a(4) = 5: 1324, 1423, 2314, 2413, 3412.
a(5) = 18: 12435, 12534, 13245, 13425, 13524, 14235, 14523, 15234, 23145, 23415, 23514, 24135, 24513, 25134, 34125, 34512, 35124, 45123.
		

Crossrefs

Column k=2 of A064315.
Cf. A086089 (3*sqrt(3)/(2*Pi)).

Programs

  • Mathematica
    A[n_, k_] := A[n, k] = Module[{b}, b[u_, o_, t_] := b[u, o, t] = If[t + o <= k, (u + o)!, Sum[b[u + i - 1, o - i, Min[k, t] + 1], {i, 1, o}] + If[t <= k, u (u + o - 1)!, Sum[b[u - i, o + i - 1, 1], {i, 1, u}]]]; Sum[b[j - 1, n - j, 1], {j, 1, n}]];
    a[n_] := A[n, 2] - A[n, 1];
    Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Oct 26 2021, after Alois P. Heinz in A064315 *)

Formula

a(n) ~ c * (3*sqrt(3)/(2*Pi))^n * n!, where c = 0.45178068752734823... . - Vaclav Kotesovec, Sep 06 2014

A228677 Number of permutations of [n] having a shortest ascending run of length 10.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 184755, 705430, 1293290, 2288130, 3922510, 6537518, 10623468, 16872568, 26246218, 40060018, 5550996791339, 46930896641461, 261675515571604, 1068582396297367, 3799177830315370, 12437930832322213, 38494027637595340
Offset: 10

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Crossrefs

Column k=10 of A064315.

A064316 Total length of shortest ascending runs of permutations of length n.

Original entry on oeis.org

1, 3, 8, 32, 142, 852, 5701, 44607, 394551, 3888380, 42208564, 501770569, 6470479293, 89975104185, 1342248988188, 21379528462151, 362090852585327, 6497538182823358, 123138900272956033, 2457584428800060462, 51519275083628478495, 1131790003448653575468
Offset: 1

Views

Author

David W. Wilson, Sep 07 2001

Keywords

Formula

a(n) = Sum_{k=1..n} k * A064315(n,k).
a(n) ~ n!. - Vaclav Kotesovec, Sep 06 2014

A186735 Number of permutations of [n] with no ascending runs of length 1 or 2.

Original entry on oeis.org

1, 0, 0, 1, 1, 1, 20, 69, 180, 1930, 12611, 61051, 566129, 5179750, 38348469, 376547340, 4169246332, 41559058969, 465750294781, 5905176350849, 72848728572828, 946103621115633, 13501160406995728, 195518567272213262, 2918439778172724571, 46559546190633191495
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Examples

			a(0) = 1: the empty permutation.
a(3) = 1: 123.
a(4) = 1: 1234.
a(5) = 1: 12345.
a(6) = 20: 123456, 124356, 125346, 126345, 134256, 135246, 136245, 145236, 146235, 156234, 234156, 235146, 236145, 245136, 246135, 256134, 345126, 346125, 356124, 456123.
		

Crossrefs

Programs

  • Mathematica
    A[n_, k_] := A[n, k] = Module[{b}, b[u_, o_, t_] := b[u, o, t] =
         If[t + o <= k, (u + o)!,
         Sum[b[u + i - 1, o - i, Min[k, t] + 1], {i, 1, o}] +
         If[t <= k, u*(u + o - 1)!,
         Sum[b[u - i, o + i - 1, 1], {i, 1, u}]]];
      Sum[b[j - 1, n - j, 1], {j, 1, n}]];
    a[n_] := n! - A[n, 2];
    Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Sep 03 2021, after Alois P. Heinz in A064315 *)

Formula

a(n) = A000142(n) - A228614(n) - A185652(n).

A228670 Number of permutations of [n] having a shortest ascending run of length 3.

Original entry on oeis.org

1, 0, 0, 19, 68, 110, 1679, 11941, 59470, 528974, 4907480, 36965659, 370685663, 4086527638, 40650345653, 458464525689, 5857242113368, 72283039099029, 938515852729074, 13416951764772945, 194738851363141390, 2909111655448399908, 46421744844240409407
Offset: 3

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Examples

			a(3) = 1: 123.
a(6) = 19: 124356, 125346, 126345, 134256, 135246, 136245, 145236, 146235, 156234, 234156, 235146, 236145, 245136, 246135, 256134, 345126, 346125, 356124, 456123.
		

Crossrefs

Column k=3 of A064315.

Formula

a(n) ~ c * d^n * n!, where d = 0.63140578989563018836245602310621356272419174622597338..., c = 0.2944330707154006599431970237808940992565854768253334... . - Vaclav Kotesovec, Sep 07 2014

A228671 Number of permutations of [n] having a shortest ascending run of length 4.

Original entry on oeis.org

1, 0, 0, 0, 69, 250, 418, 658, 34649, 266267, 1369372, 5082045, 76637635, 876858377, 7147459470, 47396097511, 552146011437, 7418289082402, 82776784289657, 769968963165506, 9270154198456497, 136873296441831662, 1900983368776814542, 22997984983317347728
Offset: 4

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Examples

			T(4) = 1: 1234.
T(8) = 69: 12354678, 12364578, ..., 46781235, 56781234.
		

Crossrefs

Column k=4 of A064315.

Formula

a(n) ~ c * d^n * n!, where d = 0.50498188279961731119..., c = 0.223130847130100218... . - Vaclav Kotesovec, Sep 07 2014

A228672 Number of permutations of [n] having a shortest ascending run of length 5.

Original entry on oeis.org

1, 0, 0, 0, 0, 251, 922, 1582, 2572, 4002, 756755, 6029297, 31742676, 120956707, 398182782, 12794989968, 166170816448, 1418774022895, 9698826682676, 55499002033421, 894582818429967, 14637215156295242, 177486208140377619, 1730337098015002802
Offset: 5

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Crossrefs

Column k=5 of A064315.

Formula

a(n) ~ c * d^n * n!, where d = 0.4206507959..., c = 0.1811532007... . - Vaclav Kotesovec, Sep 07 2014

A228673 Number of permutations of [n] having a shortest ascending run of length 6.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 923, 3430, 6004, 10008, 16014, 24750, 17153135, 139520497, 747544744, 2907714483, 9788905840, 30236892651, 2389382438831, 33146052783575, 291048293120402, 2033077226586965, 11881137473504364, 61473838487159979, 1656802388288612691
Offset: 6

Views

Author

Alois P. Heinz, Aug 29 2013

Keywords

Crossrefs

Column k=6 of A064315.
Showing 1-10 of 13 results. Next