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

A056986 Number of permutations on {1,...,n} containing any given pattern alpha in the symmetric group S_3.

Original entry on oeis.org

0, 0, 1, 10, 78, 588, 4611, 38890, 358018, 3612004, 39858014, 478793588, 6226277900, 87175616760, 1307664673155, 20922754530330, 355687298451210, 6402373228089300, 121645098641568810, 2432902001612519580, 51090942147243172980, 1124000727686125116360
Offset: 1

Views

Author

Keywords

Comments

This is well-defined because for all patterns alpha in S_3 the number of permutations in S_n avoiding alpha is the same (the Catalan numbers). - Emeric Deutsch, May 05 2008

Examples

			a(4) = 10 because, taking, for example, the pattern alpha=321, we have 3214, 3241, 1432, 2431, 3421, 4213, 4132, 4231, 4312 and 4321.
		

Crossrefs

Programs

  • Magma
    A056986:= func< n | Factorial(n) - Catalan(n) >;
    [A056986(n): n in [1..30]]; // G. C. Greubel, Oct 06 2024
    
  • Maple
    a:= n-> n! -binomial(2*n, n)/(n+1):
    seq(a(n), n=1..25);  # Alois P. Heinz, Jul 05 2012
  • Mathematica
    Table[n! -CatalanNumber[n], {n,30}]
  • PARI
    a(n)=n!-binomial(n+n,n+1)/n \\ Charles R Greathouse IV, Jun 10 2011
    
  • SageMath
    def A056986(n): return factorial(n) - catalan_number(n)
    [A056986(n) for n in range(1,31)] # G. C. Greubel, Oct 06 2024

Formula

From Alois P. Heinz, Jul 05 2012: (Start)
a(n) = A214152(n, 3).
a(n) = A000142(n) - A000108(n).
a(n) = A000142(n) - A214015(n, 2). (End)
E.g.f.: 1/(1 - x) - exp(2*x)*(BesselI(0,2*x) - BesselI(1,2*x)). - Ilya Gutkovskiy, Jan 21 2017

A158005 Numbers of pattern-matching permutations of (1234) for the permutations of {1, 2, ..., n} on n = 4, 5, 6, ... elements.

Original entry on oeis.org

1, 17, 207, 2279, 24553, 268521, 3042210, 36153510, 454208895, 6059942223, 86030083110, 1299647574882, 20865826165777, 355277740280849, 6399391841784282, 121623163346687166, 2432739049821421911, 51089720946192154791, 1123991502048375026337
Offset: 4

Views

Author

Eric W. Weisstein, Mar 11 2009

Keywords

Comments

Same series for 1243 1432 2134 2143 4123 3214 3412 2341 3421 4321 4312. - R. H. Hardin, Mar 15 2009

Crossrefs

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)!/mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l)
          `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
           add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i)))
        end:
    a:= n-> n! -g(n, 3, []):
    seq(a(n), n=4..30);  # Alois P. Heinz, Jul 05 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<3, 0, `if`(n=4, 1,
          ((13-11*n-40*n^2+10*n^3+n^4)*a(n-1) -(10*n^2-9*n-31)*(n-1)^2*a(n-2)
           +9*(n-1)^2*(n-2)^2*a(n-3)) / ((n-4)*(n+2)^2)))
        end:
    seq(a(n), n=4..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    a[2] = a[3] = 0; a[4] = 1; a[n_] := a[n] = (1/((n-4)*(n+2)^2))* (9*(n-2)^2*a[n-3]*(n-1)^2 - (10*n^2 - 9*n - 31)*a[n-2]*(n-1)^2 + (n^4 + 10*n^3 - 40*n^2 - 11*n + 13)*a[n-1]); Table[a[n], {n, 4, 22}] (* Jean-François Alcover, Oct 22 2012, after Alois P. Heinz *)

Formula

a(n) = A214152(n,4) = A000142(n) - A005802(n) = A000142(n) - A214015(n,3). - Alois P. Heinz, Jul 05 2012

Extensions

More terms from R. H. Hardin, Mar 15 2009
Two more terms from Vladeta Jovovic, Aug 17 2009
Corrected a(19)-a(20) and extended by Alois P. Heinz, Jul 05 2012

A005802 Number of permutations in S_n with longest increasing subsequence of length <= 3 (i.e., 1234-avoiding permutations); vexillary permutations (i.e., 2143-avoiding).

Original entry on oeis.org

1, 1, 2, 6, 23, 103, 513, 2761, 15767, 94359, 586590, 3763290, 24792705, 167078577, 1148208090, 8026793118, 56963722223, 409687815151, 2981863943718, 21937062144834, 162958355218089, 1221225517285209, 9225729232653663, 70209849031116183, 537935616492552297
Offset: 0

Views

Author

Keywords

Comments

Also the dimension of SL(3)-invariants in V^n tensor (V^*)^n, where V is the standard 3-dimensional representation of SL(3) and V^* is its dual. - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
Also the number of doubly-alternating permutations of length 2n with no four-term increasing subsequence (i.e., 1234-avoiding doubly-alternating permutations). The doubly-alternating permutations (counted by sequence A007999) are those permutations w such that both w and w^(-1) have descent set {2, 4, 6, ...}. - Joel B. Lewis, May 21 2009
Any permutation without an increasing subsequence of length 4 has a decreasing subsequence of length >= n/3, where n is the length of the sequence, by the Erdős-Szekeres theorem. - Charles R Greathouse IV, Sep 26 2012
Also the number of permutations of length n simultaneously avoiding patterns 1324 and 3416725 (or 1324 and 3612745). - Alexander Burstein, Jan 31 2014

References

  • Eric S. Egge, Defying God: The Stanley-Wilf Conjecture, Stanley-Wilf Limits, and a Two-Generation Explosion of Combinatorics, pp. 65-82 of "A Century of Advancing Mathematics", ed. S. F. Kennedy et al., MAA Press 2015.
  • S. Kitaev, Patterns in Permutations and Words, Springer-Verlag, 2011. see p. 399 Table A.7.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.16(e), p. 453.

Crossrefs

A column of A047888. See also A224318, A223034, A223905.
Column k=3 of A214015.
A005802, A022558, A061552 are representatives for the three Wilf classes for length-four avoiding permutations (cf. A099952).

Programs

  • Maple
    a:= n-> 2*add(binomial(2*k,k)*(binomial(n,k))^2*(3*k^2+2*k+1-n-2*k*n)/ (k+1)^2/(k+2)/(n-k+1),k=0..n);
    A005802:=rsolve({a(0) = 1, a(1) = 1, (n^2 + 8*n + 16)*a(n + 2) = (10*n^2 + 42*n + 41)*a(n + 1) - (9*n^2 + 18*n + 9)*a(n)},a(n),makeproc): # Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
  • Mathematica
    a[n_] := 2Sum[Binomial[2k, k]Binomial[n, k]^2(3k^2+2k+1-n-2k*n)/((k+1)^2(k+2)(n-k+1)), {k, 0, n}]
    (* Second program:*)
    a[0] = a[1] = 1; a[n_] := a[n] = ((10*n^2+2*n-3)*a[n-1] + (-9*n^2+18*n-9)* a[n-2])/(n+2)^2; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 20 2017 *)
    Table[HypergeometricPFQ[{1/2, -1 - n, -n}, {2, 2}, 4] / (n+1), {n, 0, 25}] (* Vaclav Kotesovec, Jun 07 2021 *)
  • PARI
    a(n)=2*sum(k=0,n,binomial(2*k,k)*binomial(n,k)^2*(3*k^2+2*k+1-n-2*k*n)/(k+1)^2/(k+2)/(n-k+1)) \\ Charles R Greathouse IV, Sep 26 2012

Formula

a(n) = 2 * Sum_{k=0..n} binomial(2*k, k) * (binomial(n, k))^2 * (3*k^2 + 2*k+1 - n - 2*k*n)/((k+1)^2 * (k+2) * (n-k+1)).
(4*n^2 - 2*n + 1)*(n + 2)^2*(n + 1)^2*a(n) = (44*n^3 - 14*n^2 - 11*n + 8)*n*(n + 1)^2*a(n - 1) - (76*n^4 + 42*n^3 - 49*n^2 - 24*n + 24)*(n - 1)^2*a(n - 2) + 9*(4*n^2 + 6*n + 3)*(n - 1)^2*(n - 2)^2*a(n - 3). - Vladeta Jovovic, Jul 16 2004
a(0) = 1, a(1) = 1, (n^2 + 8*n + 16)*a(n + 2) = (10*n^2 + 42*n + 41) a(n + 1) - (9*n^2 + 18*n + 9) a(n). - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
a(n) = ((18*n+45)*A002893(n) - (7+2*n)*A002893(n+1)) / (6*(n+2)^2). - Mark van Hoeij, Jul 02 2010
G.f.: (1+5*x-(1-9*x)^(3/4)*(1-x)^(1/4)*hypergeom([-1/4, 3/4],[1],64*x/((x-1)*(1-9*x)^3)))/(6*x^2). - Mark van Hoeij, Oct 25 2011
a(n) ~ 3^(2*n+9/2)/(16*Pi*n^4). - Vaclav Kotesovec, Jul 29 2013
a(n) = Sum_{k=0..n} binomial(2k,k)*binomial(n+1,k+1)*binomial(n+2,k+1)/((n+1)^2*(n+2)). [Conway and Guttmann, Adv. Appl. Math. 64 (2015) 50]
For n > 0, (n+2)^2*a(n) - n^2*a(n-1) = 4*A086618(n). - Zhi-Wei Sun, Nov 16 2017
a(n) = hypergeom([1/2, -1 - n, -n], [2, 2], 4) / (n+1). - Vaclav Kotesovec, Jun 07 2021

Extensions

Additional comments from Emeric Deutsch, Dec 06 2000
More terms from Naohiro Nomoto, Jun 18 2001
Edited by Dean Hickerson, Dec 10 2002
More terms from Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005

A047889 Number of permutations in S_n with longest increasing subsequence of length <= 4.

Original entry on oeis.org

1, 1, 2, 6, 24, 119, 694, 4582, 33324, 261808, 2190688, 19318688, 178108704, 1705985883, 16891621166, 172188608886, 1801013405436, 19274897768196, 210573149141896, 2343553478425816, 26525044132374656, 304856947930144656
Offset: 0

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Comments

Or, number of permutations in S_n that avoid the pattern 12345, - N. J. A. Sloane, Mar 19 2015
Also, the dimension of the space of SL(4)-invariants in V^m ⊗ (V^*)^m, where V is the standard 4-dimensional representation of SL(4) and V^* its dual. - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005

Examples

			G.f. = 1 + x + 2*x^2 + 6*x^3 + 24*x^4 + 119*x^5 + 694*x^6 + 4582*x^7 + ...
		

Crossrefs

A column of A047888.
Column k=4 of A214015.
Representatives for the 16 Wilf-equivalence patterns of length 5 are given in A116485, A047889, and A256195-A256208. - N. J. A. Sloane, Mar 19 2015

Programs

  • Maple
    A:=rsolve({a(0) = 1, a(1) = 1, (n^3 + 16*n^2 + 85*n + 150)*a(n + 2) = (20*n^3 + 182*n^2 + 510*n + 428)*a(n + 1) - (64*n^3 + 256*n^2 + 320*n +128)*a(n)}, a(n), makeproc): # Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
  • Mathematica
    Flatten[{1,RecurrenceTable[{64*(-1+n)^2*n*a[-2+n]-2*(-12 + 11*n + 31*n^2 + 10*n^3)*a[-1+n] + (3+n)^2*(4+n)*a[n]==0,a[1]==1,a[2]==2},a,{n,20}]}] (* Vaclav Kotesovec, Sep 10 2014 *)
  • PARI
    {a(n) = my(v); if( n<2, n>=0, v = vector(n+1, k, 1); for(k=2, n, v[k+1] = ((20*k^3 + 62*k^2 + 22*k - 24) * v[k] - 64*k*(k-1)^2 * v[k-1]) / ((k+3)^2 * (k+4))); v[n+1])}; /* Michael Somos, Apr 19 2015 */

Formula

a(0)=1, a(1)=1, (n^3 + 16*n^2 + 85*n + 150)*a(n+2) = (20*n^3 + 182*n^2 + 510*n + 428)*a(n+1) - (64*n^3 + 256*n^2 + 320*n + 128)*a(n). - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005
a(n) = (64*(n+1)*(2*n^3 + 21*n^2 + 76*n + 89)*A002895(n) -(8*n^4 + 104*n^3 + 526*n^2 + 1098*n + 776) *A002895(n+1)) / (3*(n+2)^3*(n+3)^3*(n+4)). - Mark van Hoeij, Jun 02 2010
a(n) ~ 3 * 2^(4*n + 9) / (n^(15/2) * Pi^(3/2)). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Naohiro Nomoto, Mar 01 2002
Edited by N. J. A. Sloane, Aug 23 2008 at the suggestion of R. J. Mathar

A214152 Number of permutations T(n,k) in S_n containing an increasing subsequence of length k; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 2, 1, 6, 5, 1, 24, 23, 10, 1, 120, 119, 78, 17, 1, 720, 719, 588, 207, 26, 1, 5040, 5039, 4611, 2279, 458, 37, 1, 40320, 40319, 38890, 24553, 6996, 891, 50, 1, 362880, 362879, 358018, 268521, 101072, 18043, 1578, 65, 1, 3628800, 3628799, 3612004, 3042210, 1438112, 337210, 40884, 2603, 82, 1
Offset: 1

Views

Author

Alois P. Heinz, Jul 05 2012

Keywords

Examples

			T(3,2) = 5.  All 3! = 6 permutations of {1,2,3} contain an increasing subsequence of length 2 with the exception of 321.
Triangle T(n,k) begins:
     1;
     2,    1;
     6,    5,    1;
    24,   23,   10,    1;
   120,  119,   78,   17,   1;
   720,  719,  588,  207,  26,  1;
  5040, 5039, 4611, 2279, 458, 37,  1;
  ...
		

Crossrefs

Columns k=1-10 give: A000142 (for n>0), A033312, A056986, A158005, A158432, A159139, A159175, A217675, A217676, A217677.
Row sums give: A003316.
T(2n,n) gives A269021.
Diagonal and lower diagonals give: A000012, A002522, A217200, A217193.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= (n, i, l)-> `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
                     add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i))):
    T:= (n, k)-> n! -g(n, k-1, []):
    seq(seq(T(n, k), k=1..n), n=1..12);
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]! / Product[Product[1 + l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}] ]; g[n_, i_, l_] := If[n == 0 || i === 1, h[Join[l, Array[1&, n]]]^2, If[i < 1, 0, Sum[g[n - i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; t[n_, k_] := n! - g[n, k-1, {}]; Table[Table[t[n, k], {k, 1, n}], {n, 1, 12}] // Flatten (* Jean-François Alcover, Dec 17 2013, translated from Maple *)

Formula

T(n,k) = Sum_{i=k..n} A047874(n,i).
T(n,k) = A000142(n) - A214015(n,k-1).

A047890 Number of permutations in S_n with longest increasing subsequence of length <= 5.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 719, 5003, 39429, 344837, 3291590, 33835114, 370531683, 4285711539, 51990339068, 657723056000, 8636422912277, 117241501095189, 1639974912709122, 23570308719710838, 347217077020664880, 5231433025400049936, 80466744544235325387
Offset: 0

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Crossrefs

A column of A047888. Cf. A005802, A052399.
Column k=5 of A214015.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
          +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l)
          `if`(n=0 or i=1, h([l[], 1$n])^2, `if`(i<1, 0,
           add(g(n-i*j, i-1, [l[], i$j]), j=0..n/i)))
        end:
    a:= n-> g(n, 5, []):
    seq(a(n), n=0..30);  # Alois P. Heinz, Apr 10 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<6, n!, ((-375+400*n+843*n^2
           +322*n^3+35*n^4)*a(n-1) +225*(n-1)^2*(n-2)^2*a(n-3)
           -(259*n^2+622*n+45)*(n-1)^2*a(n-2))/ ((n+6)^2*(n+4)^2))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]]; g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i<1, 0, Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; a[n_, k_] := If[k >= n, n!, g[n, k, {}]]; Table[a[n, 5], {n, 1, 30}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)

Formula

a(n) ~ 9 * 5^(2*n + 25/2) / (512 * n^12 * Pi^2). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Naohiro Nomoto, Mar 01 2002
More terms from Alois P. Heinz, Apr 10 2012

A052399 Number of permutations in S_n with longest increasing subsequence of length <= 6.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5039, 40270, 361302, 3587916, 38957991, 457647966, 5763075506, 77182248916, 1091842643475, 16219884281650, 251774983140578, 4066273930979460, 68077194367392864, 1177729684507324152, 20995515989327134152, 384762410996641402384
Offset: 0

Views

Author

N. J. A. Sloane, Mar 13 2000

Keywords

Comments

Previous name was: Related to Young tableaux of bounded height.

Crossrefs

Column k=6 of A214015.

Programs

  • Maple
    h:= proc(l) local n; n:=nops(l); add(i, i=l)! /mul(mul(1+l[i]-j
           +add(`if`(l[k]>=j, 1, 0), k=i+1..n), j=1..l[i]), i=1..n)
        end:
    g:= proc(n, i, l) option remember;
          `if`(n=0, h(l)^2, `if`(i<1, 0, `if`(i=1, h([l[], 1$n])^2,
           g(n, i-1, l)+ `if`(i>n, 0, g(n-i, i, [l[], i])))))
        end:
    a:= n-> g(n, 6, []):
    seq(a(n), n=0..25); # Alois P. Heinz, Apr 10 2012
    # second Maple program
    a:= proc(n) option remember; `if`(n<7, n!,
          ((56*n^5-9408+11032*n+19028*n^2+7360*n^3+1092*n^4)*a(n-1)
           -4*(196*n^3+1608*n^2+3167*n+444)*(n-1)^2*a(n-2)
           +1152*(2*n+3)*(n-1)^2*(n-2)^2*a(n-3))/ ((n+9)*(n+8)^2*(n+5)^2))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Sep 26 2012
  • Mathematica
    h[l_] := With[{n = Length[l]}, Sum[i, {i, l}]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]]; g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i<1, 0, Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; a[n_, k_] := If[k >= n, n!, g[n, k, {}]]; Table[a[n, 6], {n, 0, 30}] (* Jean-François Alcover, Mar 11 2014, after Alois P. Heinz *)

Formula

a(n) ~ 5 * 2^(2*n + 6) * 3^(2*n + 21) / (n^(35/2) * Pi^(5/2)). - Vaclav Kotesovec, Sep 10 2014

Extensions

More terms from Alois P. Heinz, Apr 10 2012
New name from Vaclav Kotesovec, Sep 10 2014

A047888 Rectangular array of numbers a(n,k) = number of permutations of n things with longest increasing subsequence of length <= k (1 <= k <= oo), read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 5, 2, 1, 1, 14, 6, 2, 1, 1, 42, 23, 6, 2, 1, 1, 132, 103, 24, 6, 2, 1, 1, 429, 513, 119, 24, 6, 2, 1, 1, 1430, 2761, 694, 120, 24, 6, 2, 1, 1, 4862, 15767, 4582, 719, 120, 24, 6, 2, 1, 1, 16796, 94359, 33324, 5003, 720, 120, 24, 6, 2, 1, 1, 58786, 586590
Offset: 1

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Comments

Also a(n,k) is the dimension of the space of SL(k)-invariants in V^n tensor (V^*)^n, where V is the standard k-dimensional representation of SL(k) and V^* is its dual. - Alec Mihailovs (alec(AT)mihailovs.com), Aug 14 2005

Examples

			Square array a(n,k) begins:
  1,   1,    1,    1,    1,    1, ...
  1,   2,    2,    2,    2,    2, ...
  1,   5,    6,    6,    6,    6, ...
  1,  14,   23,   24,   24,   24, ...
  1,  42,  103,  119,  120,  120, ...
  1, 132,  513,  694,  719,  720, ...
		

Crossrefs

Rows of the array are partial sums of A047874. Cf. A047887.
Subarray of A214015.

Programs

  • Mathematica
    rows = 12; h[l_List] := Module[{n = Length[l]}, Total[l]!/Product[Product[1+l[[i]]-j+Sum[If[l[[k]] >= j, 1, 0], {k, i+1, n}], {j, 1, l[[i]]}], {i, 1, n}]] ; g[n_, i_, l_List] := If[n == 0 || i == 1, h[Join[l, Array[1&, n]]]^2, If[i<1, 0, Sum[g[n-i*j, i-1, Join[l, Array[i&, j]]], {j, 0, n/i}]]]; T[n_] := Table[g[n-k, Min[n-k, k], {k}], {k, 1, rows}] // Accumulate; A047888 = Table[T[n], {n, 1, rows}]; Table[A047888[[n-k+1, k]], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 06 2014, after Alois P. Heinz *)
  • PARI
    b(n, k) = {
      my(x = 'x + O('x^(2*n)));
      sum(i = 0, n, x^(2*i+k)/(i!*(i+k)!));
    };
    u(n, k) = {
      my(v = Vec(matdet(matrix(k, k, i, j, b(n, abs(i-j))))));
      return(vector((#v-1)\2, i, v[2*i+1] * i!^2));
    };
    A(n, k) = {
      my(m = [;]);
      for (i = 1, k, m = concat(m, u(n, i)~));
      return(m);
    };
    A(6, 6)  \\ Gheorghe Coserea, Feb 02 2016

Extensions

More terms from Naohiro Nomoto, Mar 01 2002

A267479 Number A(n,k) of words on {1,1,2,2,...,n,n} with longest increasing subsequence of length <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 6, 1, 0, 1, 1, 6, 43, 1, 0, 1, 1, 6, 90, 352, 1, 0, 1, 1, 6, 90, 1879, 3114, 1, 0, 1, 1, 6, 90, 2520, 47024, 29004, 1, 0, 1, 1, 6, 90, 2520, 102011, 1331664, 280221, 1, 0, 1, 1, 6, 90, 2520, 113400, 5176504, 41250519, 2782476, 1, 0
Offset: 0

Views

Author

Alois P. Heinz, Jan 15 2016

Keywords

Examples

			Square array A(n,k) begins:
  1, 1,     1,       1,       1,       1,       1, ...
  0, 1,     1,       1,       1,       1,       1, ...
  0, 1,     6,       6,       6,       6,       6, ...
  0, 1,    43,      90,      90,      90,      90, ...
  0, 1,   352,    1879,    2520,    2520,    2520, ...
  0, 1,  3114,   47024,  102011,  113400,  113400, ...
  0, 1, 29004, 1331664, 5176504, 7235651, 7484400, ...
		

Crossrefs

Columns k=0-4 give: A000007, A000012, A220097, A266734, A266735.
Main diagonal gives A000680.
First lower diagonal gives A267532.

Formula

A(n,k) = Sum_{i=0..k} A267480(n,i).

A047887 Triangle of numbers T(n,k) = number of permutations of n things with longest increasing subsequence of length <=k (1<=k<=n).

Original entry on oeis.org

1, 1, 2, 1, 5, 6, 1, 14, 23, 24, 1, 42, 103, 119, 120, 1, 132, 513, 694, 719, 720, 1, 429, 2761, 4582, 5003, 5039, 5040, 1, 1430, 15767, 33324, 39429, 40270, 40319, 40320, 1, 4862, 94359, 261808, 344837, 361302, 362815, 362879, 362880, 1, 16796
Offset: 1

Views

Author

Eric Rains (rains(AT)caltech.edu), N. J. A. Sloane

Keywords

Examples

			Triangle T(n,k) begins:
  1;
  1,   2;
  1,   5,    6;
  1,  14,   23,   24;
  1,  42,  103,  119,  120;
  1, 132,  513,  694,  719,  720;
  1, 429, 2761, 4582, 5003, 5039, 5040;
  ...
		

Crossrefs

Rows are partial sums of A047874.

Programs

  • Mathematica
    h[l_] := Module[{n = Length[l]}, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[l[[k]] >= j, 1, 0], {k, i + 1, n}], {j, 1, l[[i]]}], {i, 1, n}]];
    g[n_, i_, l_] := If[n == 0 || i == 1, h[Join[l, Array[1 &, n]]]^2, If[i < 1, 0, Sum[g[n - i*j, i - 1, Join[l, Array[i &, j]]], {j, 0, n/i}]]];
    T[n_] := Table[g[n - k, Min[n - k, k], {k}], {k, 1, n}] // Accumulate;
    Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, Mar 24 2016, after Alois P. Heinz *)

Extensions

More terms from Naohiro Nomoto, Mar 01 2002
Showing 1-10 of 22 results. Next