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

A003517 Number of permutations of [n+1] with exactly 1 increasing subsequence of length 3.

Original entry on oeis.org

1, 6, 27, 110, 429, 1638, 6188, 23256, 87210, 326876, 1225785, 4601610, 17298645, 65132550, 245642760, 927983760, 3511574910, 13309856820, 50528160150, 192113383644, 731508653106, 2789279908316, 10649977831752, 40715807302800, 155851062397940, 597261490737912
Offset: 2

Views

Author

Keywords

Comments

a(n-4) = number of n-th generation vertices in the tree of sequences with unit increase labeled by 5 (cf. Zoran Sunic reference). - Benoit Cloitre, Oct 07 2003
Number of standard tableaux of shape (n+3,n-2). - Emeric Deutsch, May 30 2004
a(n) = A214292(2*n,n-3) for n > 2. - Reinhard Zumkeller, Jul 12 2012
a(n) is the number of North-East paths from (0,0) to (n,n) that cross the diagonal y = x horizontally exactly once. By symmetry, it is also the number of North-East paths from (0,0) to (n,n) that cross the diagonal y = x vertically exactly once. Details can be found in Section 3.3 in Pan and Remmel's link. - Ran Pan, Feb 02 2016
a(n) is the number of permutations pi of [n+3] such that s(pi)=321456...(n+3), where s denotes West's stack-sorting map. - Colin Defant, Jan 14 2019
a(n) is also the number of permutations of [n+1] avoiding the pattern 321. For permutations avoiding any of the other permutations of [3] (that is, any of 132, 213, 231, or 312) see A002054. - N. J. A. Sloane, Nov 26 2022

Examples

			a(3)=6 because the only permutations of 1234 with exactly 1 increasing subsequence of length 3 are 1423, 4123, 1342, 2314, 2341, 3124.
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

T(n, n+6) for n=0, 1, 2, ..., array T as in A047072.
See also A002054.
First differences are in A026017.
A diagonal of any of the essentially equivalent arrays: A009766, A030237, A033184, A059365, A099039, A106566, A130020, A047072.

Programs

  • Maple
    A003517List := proc(m) local A, P, n; A := [1]; P := [1,1,1,1,1];
    for n from 1 to m - 2 do P := ListTools:-PartialSums([op(P), P[-1]]);
    A := [op(A), P[-1]] od; A end: A003517List(25); # Peter Luschny, Mar 26 2022
  • Mathematica
    f[x_] = (Sqrt[1 - 4 x] - 1)^6/(64 x^4); CoefficientList[Series[f[x], {x, 0, 25}], x][[3 ;; 26]] (* Jean-François Alcover, Jul 13 2011, after g.f. *)
    Table[6 Binomial[2n+1,n-2]/(n+4),{n,2,30}] (* Harvey P. Dale, Feb 27 2012 *)
  • PARI
    a(n)=6*binomial(2*n+1,n-2)/(n+4) \\ Charles R Greathouse IV, May 18 2015
    
  • PARI
    x='x+O('x^50); Vec(x^2*((1-(1-4*x)^(1/2))/(2*x))^6) \\ Altug Alkan, Nov 01 2015

Formula

a(n) = 6*binomial(2*n+1, n-2)/(n+4).
G.f.: x^2*C(x)^6, where C(x) is g.f. for the Catalan numbers (A000108). - Emeric Deutsch, May 30 2004
E.g.f.: exp(2*x)*(Bessel_I(2,2*x) - Bessel_I(4,2*x)). - Paul Barry, Jun 04 2007
Let A be the Toeplitz matrix of order n defined by: A[i,i-1]=-1, A[i,j]=Catalan(j-i), (i<=j), and A[i,j]=0, otherwise. Then, for n >= 5, a(n-3) = (-1)^(n-5)*coeff(charpoly(A,x),x^5). - Milan Janjic, Jul 08 2010
a(n) = Sum_{i>=1, j>=1, k>=1, i+j+k=n+1} Catalan(i)*Catalan(j)*Catalan(k). T. D. Noe, Dec 22 2010
D-finite with recurrence -(n+4)*(n-2)*a(n) + 2*n*(2*n+1)*a(n-1) = 0. - R. J. Mathar, Dec 04 2012
From Amiram Eldar, Jan 02 2022: (Start)
Sum_{n>=2} 1/a(n) = 7/2 - 34*Pi/(27*sqrt(3)).
Sum_{n>=2} (-1)^n/a(n) = 828*log(phi)/(25*sqrt(5)) - 2819/450, where phi is the golden ratio (A001622). (End)
a(n) ~ 3*4^(n+1)/(n^(3/2)*sqrt(Pi)). - Stefano Spezia, Apr 17 2024
a(n) = A000108(n+3) - 4*A000108(n+2) + 3*A000108(n+1). - Taras Goy, Jul 15 2024
a(n) = 6*(2*n+1)!*(n-1)!/((2*n-4)!*(n+4)!)*A000108(n-2). - Taras Goy, Dec 21 2024

A138159 Triangle read by rows: T(n,k) is the number of permutations of [n] having k occurrences of the pattern 321 (n>=1, 0<=k<=n(n-1)(n-2)/6).

Original entry on oeis.org

1, 1, 2, 5, 1, 14, 6, 3, 0, 1, 42, 27, 24, 7, 9, 6, 0, 4, 0, 0, 1, 132, 110, 133, 70, 74, 54, 37, 32, 24, 12, 16, 6, 6, 8, 0, 0, 5, 0, 0, 0, 1, 429, 429, 635, 461, 507, 395, 387, 320, 260, 232, 191, 162, 104, 130, 100, 24, 74, 62, 18, 32, 10, 30, 13, 8, 0, 10, 10, 0, 0, 0, 6, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Emeric Deutsch, Mar 27 2008

Keywords

Comments

Row n has 1 + n(n-1)(n-2)/6 terms.
Sum of row n is n! (A000142).
T(n,0) = A000108(n) (the Catalan numbers).
T(n,1) = A003517(n-1).
T(n,2) = A001089(n).
Sum_{k>=0} k * T(n,k) = A001810(n).

Examples

			T(4,2) = 3 because we have 4312, 4231 and 3421.
Triangle starts:
    1;
    1;
    2;
    5,   1;
   14,   6,   3,  0,  1;
   42,  27,  24,  7,  9,  6,  0,  4,  0,  0,  1;
  132, 110, 133, 70, 74, 54, 37, 32, 24, 12, 16, 6, 6, 8, 0, 0, 5, 0, 0, 0, 1;
  ...
		

Crossrefs

Programs

  • Maple
    # The following Maple program yields row 9 of the triangle; change the value of n to obtain other rows.
    n:=9: with(combinat): P:=permute(n): f:=proc(k) local L: L:=proc(j) local ct, i: ct:=0: for i to j-1 do if P[k][j] < P[k][i] then ct:=ct+1 else end if end do: ct end proc: add(L(j)*(L(j)+P[k][j]-j),j=1..n) end proc: a:=sort([seq(f(k),k=1..factorial(n))]): for h from 0 to (1/6)*n*(n-1)*(n-2) do c[h]:=0: for m to factorial(n) do if a[m]=h then c[h]:=c[h]+1 else end if end do end do: seq(c[h],h=0..(1/6)*n*(n-1)*(n-2));
    # second Maple program:
    b:= proc(s, c) option remember; (n-> `if`(n=0, x^c, add(b(s minus {j},
          (t-> (j-n+t)*t+c)(nops(select(x-> x>j, s)))), j=s)))(nops(s))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b({$1..n}, 0)):
    seq(T(n), n=0..9);  # Alois P. Heinz, Dec 01 2021
  • Mathematica
    ro[n_] := With[{}, P = Permutations[Range[n]]; f[k_] := With[{}, L[j_] := With[{}, ct = 0; Do[If[P[[k, j]] < P[[k, i]], ct = ct + 1], {i, 1, j - 1}]; ct]; Sum[L[j]*(L[j] + P[[k, j]] - j), {j, 1, n}]]; a = Sort[Table[f[k], {k, 1, n!}]]; Do[c[h] = 0; Do[If[a[[m]] == h, c[h] = c[h] + 1], {m, 1, n!}], {h, 0, (1/6)*n*(n - 1)*(n - 2)}]; Table[c[h], {h, 0, (1/6)*n*(n - 1)*(n - 2)}]]; Flatten[Table[ro[n], {n, 1, 7}]] (* Jean-François Alcover, Sep 01 2011, after Maple *)

Formula

The number of 321-patterns of a given permutation p of [n] is given by Sum(L[i]R[i],i=1..n), where L (R) is the left (right) inversion vector of p. L and R are related by R[i]+i=p[i]+L[i] (the given Maple program makes use of this approach). References contain formulas and generating functions for the first few columns (some are only conjectured).

A084249 Triangle T(n,k) read by rows: permutations on 123...n with one abc pattern and no aj pattern with j<=k, n>2, k

Original entry on oeis.org

1, 6, 2, 27, 12, 3, 110, 55, 19, 4, 429, 229, 91, 27, 5, 1638, 912, 393, 136, 36, 6, 6188, 3549, 1614, 612, 191, 46, 7, 23256, 13636, 6447, 2601, 897, 257, 57, 8, 87210, 52020, 25332, 10695, 3951, 1260, 335, 69, 9, 326876, 197676, 98532
Offset: 3

Views

Author

Ralf Stephan, May 21 2003

Keywords

Comments

See A228708 for further information.

Examples

			Full triangle begins:
0
0,0
0,0,0
1,1,0,0
6,6,2,0,0
27,27,12,3,0,0
110,110,55,19,4,0,0
429,429,229,91,27,5,0,0
1638,1638,912,393,136,36,6,0,0
6188,6188,3549,1614,612,191,46,7,0,0
23256,23256,13636,6447,2601,897,257,57,8,0,0
...
		

Crossrefs

See A228708 for the full triangle.
T(n, 1) = A003517(n+1). Cf. A001089.

Programs

  • PARI
    for(n=1,15, for(k=1,n-2,print1(binomial(2*n-k-1,n)-binomial(2*n-k-1,n+3)+binomial(2*n-2*k-2,n-k-4)-binomial(2*n-2*k-2,n-k-1)+binomial(2*n-2*k-3,n-k-4)-binomial(2*n-2*k-3,n-k-2)",")))

Formula

T(n, k) = C(2n-k-1, n) - C(2n-k-1, n+3) + C(2n-2k-2, n-k-4) - C(2n-2k-2, n-k-1) + C(2n-2k-3, n-k-4) - C(2n-2k-3, n-k-2).
T(n, n-2) = n-2, T(n, k) = T(n, k+1) + T(n-1, k-1) + T(n-k, 2).

A228708 Triangle T(n,k) read by rows: T(n,k) = number of permutations on 123...n with exactly one abc pattern and no aj pattern with j<=k, for n>=0, 0<=k<=n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 6, 6, 2, 0, 0, 27, 27, 12, 3, 0, 0, 110, 110, 55, 19, 4, 0, 0, 429, 429, 229, 91, 27, 5, 0, 0, 1638, 1638, 912, 393, 136, 36, 6, 0, 0, 6188, 6188, 3549, 1614, 612, 191, 46, 7, 0, 0, 23256, 23256, 13636, 6447, 2601, 897, 257, 57, 8, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Sep 15 2013

Keywords

Comments

See Noonan-Zeilberger for precise definition.

Examples

			Triangle begins:
0
0,0
0,0,0
1,1,0,0
6,6,2,0,0
27,27,12,3,0,0
110,110,55,19,4,0,0
429,429,229,91,27,5,0,0
1638,1638,912,393,136,36,6,0,0
6188,6188,3549,1614,612,191,46,7,0,0
23256,23256,13636,6447,2601,897,257,57,8,0,0
...
		

Crossrefs

See A084249 for a curtailed version. See also A229158, A229160.
T(n, 1) = A003517(n+1). Cf. A001089.

Programs

  • PARI
    for(n=1,15, for(k=1,n-2,print1(binomial(2*n-k-1,n)-binomial(2*n-k-1,n+3)+binomial(2*n-2*k-2,n-k-4)-binomial(2*n-2*k-2,n-k-1)+binomial(2*n-2*k-3,n-k-4)-binomial(2*n-2*k-3,n-k-2)",")))

Formula

T(n, k) = C(2n-k-1, n) - C(2n-k-1, n+3) + C(2n-2k-2, n-k-4) - C(2n-2k-2, n-k-1) + C(2n-2k-3, n-k-4) - C(2n-2k-3, n-k-2).
T(n, n-2) = n-2, T(n, k) = T(n, k+1) + T(n-1, k-1) + T(n-k, 2).

A229158 Triangle T(n,k) read by rows: T(n,k) = number of permutations on 123...n with exactly two abc patterns and no aj pattern with j<=k, for n>=0, 0<=k<=n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 1, 0, 0, 24, 24, 12, 2, 0, 0, 133, 133, 74, 23, 3, 0, 0, 635, 635, 371, 141, 36, 4, 0, 0, 2807, 2807, 1688, 709, 227, 51, 5, 0, 0, 11864, 11864, 7276, 3248, 1168, 334, 68, 6, 0, 0, 48756, 48756, 30340, 14121, 5459, 1771, 464, 87, 7, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, Sep 15 2013

Keywords

Comments

See Noonan-Zeilberger for precise definition.

Examples

			Triangle begins:
0,
0,0,
0,0,0,
0,0,0,0,
3,3,1,0,0,
24,24,12,2,0,0,
133,133,74,23,3,0,0,
635,635,371,141,36,4,0,0,
2807,2807,1688,709,227,51,5,0,0,
11864,11864,7276,3248,1168,334,68,6,0,0,
48756,48756,30340,14121,5459,1771,464,87,7,0,0
...
		

Crossrefs

Showing 1-5 of 5 results.