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

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

A263771 Triangle read by rows: T(n,k) (n>=0, k>=0) is the number of permutations of n and k occurrences of the pattern 312.

Original entry on oeis.org

1, 1, 2, 5, 1, 14, 5, 4, 1, 42, 21, 23, 14, 12, 5, 3, 132, 84, 107, 82, 96, 55, 64, 37, 29, 22, 10, 0, 2, 429, 330, 464, 410, 526, 394, 475, 365, 360, 298, 281, 175, 206, 126, 93, 55, 23, 14, 13, 1, 2, 1430, 1287, 1950, 1918, 2593, 2225, 2858, 2489, 2682, 2401
Offset: 0

Views

Author

Christian Stump, Oct 26 2015

Keywords

Comments

Row sums give A000142.
First column gives A000108.
Also the number of permutations of n and k occurrences of either of the fixed pattern 132, 213, 231 (these are all connected by reverses and inverses).
Columns k=1-5 give: A002054(n-2) for n>=3, A082970, A082971, A138162, A138163. - Alois P. Heinz, Oct 27 2015

Examples

			Triangle begins:
    1;
    1;
    2;
    5,  1;
   14,  5,   4,  1;
   42, 21,  23, 14, 12,  5,  3;
  132, 84, 107, 82, 96, 55, 64, 37, 29, 22, 10, 0, 2;
  ...
		

Crossrefs

Programs

  • Mathematica
    Join@@Array[Table[Length@Select[Permutations@Range@#,Length@Select[Subsets[#,{3}],Ordering@Ordering@#=={3,1,2}&]==k&],{k,0,Binomial[#+1,3]}]//.{a__,0}:>{a}&,8,0]  (* Giorgos Kalogeropoulos, Mar 26 2021 *)

Formula

Sum_{k>0} k * T(n,k) = A001810(n). - Alois P. Heinz, Oct 27 2015

Extensions

More terms from Alois P. Heinz, Oct 26 2015

A342860 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 2413. 0 <= k <= A342854(n).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 9, 8, 512, 62, 82, 34, 28, 2, 2740, 402, 612, 384, 466, 94, 232, 42, 60, 8, 15485, 2593, 4187, 3036, 4356, 1746, 3132, 1064, 1918, 909, 654, 333, 612, 144, 104, 22, 24, 1, 91245, 16921, 28065, 21638, 33274, 17598, 31180, 12942, 24000, 14290, 15434, 7770, 15692, 5965, 6896, 3947, 5660, 2226, 3674, 1314, 1512, 516, 508, 204, 332, 37, 40
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the pattern 3142.
First column is A022558.

Examples

			Triangle begins:
  n\k|       0       1        2        3        4        5        6
  ---+------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,      1;
   5 |     103,      9,       8;
   6 |     512,     62,      82,      34,      28,       2;
   7 |    2740,    402,     612,     384,     466,      94,     232, ...
   8 |   15485,   2593,    4187,    3036,    4356,    1746,    3132, ...
   9 |   91245,  16921,   28065,   21638,   33274,   17598,   31180, ...
  10 |  555662, 112196,  188514,  149946,  237128,  140954,  257686, ...
  11 | 3475090, 755920, 1278590, 1036826, 1658064, 1041598, 1933438, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342861 (1324), A342862 (2143), A342863 (1243), A342864 (1432), A342865 (1234).

A001089 Number of permutations of [n] containing exactly 2 increasing subsequences of length 3.

Original entry on oeis.org

0, 0, 0, 0, 3, 24, 133, 635, 2807, 11864, 48756, 196707, 783750, 3095708, 12152855, 47500635, 185082495, 719559600, 2793121080, 10830450780, 41965864794, 162539516448, 629399492330, 2437072038302, 9437097796918
Offset: 0

Views

Author

John Thomas Noonan [ noonan(AT)euclid.math.temple.edu ]

Keywords

Examples

			For n=4, there are 4! = 24 permutations of 1234. The identity permutation 1234 has four increasing subsequences of length 3 (123, 124, 134, and 234), and the permutation 2314 has only one increasing subsequence of length 3 (234). Only the permutations 1243, 1324, and 2134 have exactly two increasing subsequences of length 3, and since there are three of them, a(4) = 3. - _Michael B. Porter_, Sep 03 2016
		

Crossrefs

Leading column of A229158.

Programs

  • GAP
    Concatenation([0,0,0,0], List([4..30], n-> (100+117*n+59*n^2)* Binomial(2*n,n-4)/(2*n*(2*n-1)*(n+5)))); # G. C. Greubel, Sep 19 2019
  • Magma
    [0,0,0,0] cat [(100+117*n+59*n^2)*Binomial(2*n,n-4)/(2*n*(2*n-1)*(n+5)): n in [4..30]]; // G. C. Greubel, Sep 19 2019
    
  • Maple
    seq(`if`(n=0, 0, (100+117*n+59*n^2)*binomial(2*n, n-4)/(2*n*(2*n-1)*(n+5))), n = 0..30); # G. C. Greubel, Sep 19 2019
  • Mathematica
    {0}~Join~CoefficientList[Series[((x^5-3x^4+5x^3-10x^2+6*x-1)(1-4x)^(1/2) - 5x^5+7x^4-17x^3+20x^2-8*x+1)/(2x^6), {x,0,23}], x] (* or *)
    {0}~Join~CoefficientList[Series[x^5*((1-(1-4x)^(1/2))/(2x))^11 +3x^3*( (1-(1-4x)^(1/2))/(2x))^8, {x,0,23}], x] (* Michael De Vlieger, Sep 03 2016 *)
  • PARI
    a(n) = (100+117*n+59*n^2)*binomial(2*n,n-4)/(2*n*(2*n-1)*(n+5)) \\ G. C. Greubel, Sep 19 2019
    
  • Sage
    [0,0,0,0]+[(100+117*n+59*n^2)*binomial(2*n,n-4)/(2*n*(2*n-1)*(n+5)) for n in (4..30)] # G. C. Greubel, Sep 19 2019
    

Formula

Noonan and Zeilberger conjectured that a(n) = ((59*n^2+117*n+100) /(2*n*(2*n-1)*(n+5))) *binomial(2*n,n-4). This was proved by Fulmek.
G.f.: ((x^5 -3*x^4 +5*x^3 -10*x^2 +6*x -1)*(1-4*x)^(1/2) - 5*x^5 +7*x^4 -17*x^3 +20*x^2 -8*x +1)/(2*x^6). - Mark van Hoeij, Oct 25 2011
G.f.: x^5*C(x)^11 + 3*x^3*C(x)^8, where C(x) is g.f. for the Catalan numbers (A000108). - Michael D. Weiner, Sep 02 2016
D-finite with recurrence -(n+5)*(n-4)*(59*n^2-n+42)*a(n) +2*(n-1)*(2*n-3)*(59*n^2 +117*n+100)*a(n-1) = 0, equivalent to recurrence of [Noonan-Zeilberger] binomial. - R. J. Mathar, Jan 04 2017

Extensions

Terms a(25) onward added by G. C. Greubel, Sep 19 2019

A342861 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 1324. 0 <= k <= A342853(n).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 10, 6, 1, 513, 75, 74, 26, 17, 9, 6, 2762, 522, 645, 321, 290, 130, 166, 47, 54, 48, 41, 4, 8, 2, 15793, 3579, 5023, 3058, 3232, 1527, 2228, 874, 1159, 893, 875, 340, 503, 281, 269, 207, 156, 112, 123, 21, 54, 2, 0, 6, 5
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the pattern 4231.
First column is A061552.

Examples

			Triangle begins:
  n\k|       0        1        2        3        4        5        6
  ---+-------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,       1;
   5 |     103,      10,       6,       1;
   6 |     513,      75,      74,      26,      17,       9,       6;
   7 |    2762,     522,     645,     321,     290,     130,     166, ...
   8 |   15793,    3579,    5023,    3058,    3232,    1527,    2228, ...
   9 |   94776,   24670,   37549,   26174,   30409,   15966,   23762, ...
  10 |  591950,  172198,  277089,  213122,  264667,  154452,  228665, ...
  11 | 3824112, 1219974, 2043416, 1693787, 2213548, 1420513, 2086877, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342860 (2413), A342862 (2143), A342863 (1243), A342864 (1432), A342865 (1234).

A342862 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 2143. 0 <= k <= A028723(n + 1).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 11, 4, 2, 513, 88, 53, 33, 18, 8, 6, 0, 0, 1, 2761, 642, 495, 340, 262, 160, 172, 65, 58, 39, 14, 6, 18, 0, 0, 6, 0, 0, 2, 15767, 4567, 4099, 3007, 2692, 1832, 2171, 1152, 1291, 968, 728, 457, 566, 174, 176, 221, 129, 14, 122, 29, 38, 52, 8, 0, 32, 9, 0, 10, 0, 0, 8, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the pattern 3412.
First column is A005802.

Examples

			Triangle begins:
  n\k|       0        1        2        3        4        5        6
  ---+-------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,       1;
   5 |     103,      11,       4,       2;
   6 |     513,      88,      53,      33,      18,       8,       6, ...
   7 |    2761,     642,     495,     340,     262,     160,     172, ...
   8 |   15767,    4567,    4099,    3007,    2692,    1832,    2171, ...
   9 |   94359,   32443,   32345,   25049,   24492,   17732,   21841, ...
  10 |  586590,  232189,  250371,  203452,  211291,  160561,  201524, ...
  11 | 3763290, 1679295, 1926145, 1635315, 1776655, 1409304, 1787218, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342860 (2413), A342861 (1324), A342863 (1243), A342864 (1432), A342865 (1234).

A342863 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 1243. 0 <= k <= A028723(n + 1).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 11, 4, 2, 513, 88, 56, 32, 14, 7, 9, 0, 0, 1, 2761, 638, 543, 341, 235, 138, 173, 51, 42, 47, 34, 6, 17, 4, 0, 7, 1, 0, 2, 15767, 4478, 4600, 3119, 2658, 1710, 2180, 972, 975, 877, 771, 356, 542, 233, 184, 266, 157, 81, 130, 41, 60, 49, 16, 16, 37, 8, 9, 13, 3, 0, 10, 1, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the patterns 2134, 3421, and 4312.
First column is A005802.

Examples

			Table begins:
  n\k|       0        1        2        3        4        5        6
  ---+-------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,       1;
   5 |     103,      11,       4,       2;
   6 |     513,      88,      56,      32,      14,       7,       9, ...
   7 |    2761,     638,     543,     341,     235,     138,     173, ...
   8 |   15767,    4478,    4600,    3119,    2658,    1710,    2180, ...
   9 |   94359,   31199,   36691,   26602,   25756,   17628,   22984, ...
  10 |  586590,  218033,  284370,  218957,  231390,  166338,  221429, ...
  11 | 3763290, 1535207, 2174352, 1767837, 1994176, 1496134, 2028316, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342860 (2413), A342861 (1324), A342862 (2143), A342864 (1432), A342865 (1234).

A342864 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 1432. 0 <= k <= A100354(n).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 11, 5, 0, 1, 513, 87, 68, 17, 18, 10, 0, 4, 2, 0, 1, 2761, 625, 626, 268, 274, 138, 112, 58, 51, 44, 31, 9, 15, 8, 12, 0, 5, 0, 0, 0, 3, 15767, 4378, 5038, 2781, 3060, 1697, 1817, 1036, 964, 773, 656, 450, 379, 320, 285, 148, 237, 97, 98, 55, 68, 61, 23, 30, 30, 13, 30, 0, 0, 0, 16, 0, 10, 0, 0, 1, 0, 0, 0, 0, 2
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the patterns 2341, 3214, and 4123.
First column is A005802.

Examples

			Table begins:
  n\k|       0        1        2        3        4        5        6
  ---+-------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,       1;
   5 |     103,      11,       5,       0,       1;
   6 |     513,      87,      68,      17,      18,      10,       0, ...
   7 |    2761,     625,     626,     268,     274,     138,     112, ...
   8 |   15767,    4378,    5038,    2781,    3060,    1697,    1817, ...
   9 |   94359,   30671,   38541,   24731,   28881,   17943,   21193, ...
  10 |  586590,  216883,  289785,  205853,  251051,  170941,  211942, ...
  11 | 3763290, 1552588, 2172387, 1663964, 2096207, 1535129, 1954751, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342860 (2413), A342861 (1324), A342862 (2143), A342863 (1243), A342865 (1234).

A342865 Irregular table read by rows: T(n,k) is the number of permutations in S_n that have exactly k occurrences of the pattern 1234. 0 <= k <= A000332(n).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 103, 12, 4, 0, 0, 1, 513, 102, 63, 10, 6, 12, 8, 0, 0, 5, 0, 0, 0, 0, 0, 1, 2761, 770, 665, 196, 146, 116, 142, 46, 10, 72, 32, 24, 0, 13, 0, 12, 18, 0, 0, 10, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Peter Kagey, Mar 26 2021

Keywords

Comments

Equivalently the table for the pattern 4321.
First column is A005802.

Examples

			Table begins:
  n\k|       0        1        2        3        4        5        6
  ---+-------------------------------------------------------------------
   0 |       1;
   1 |       1;
   2 |       2;
   3 |       6;
   4 |      23,       1;
   5 |     103,      12,       4,       0,       0,       1;
   6 |     513,     102,      63,      10,       6,      12,       8, ...
   7 |    2761,     770,     665,     196,     146,     116,     142, ...
   8 |   15767,    5545,    5982,    2477,    2148,    1204,    1782, ...
   9 |   94359,   39220,   49748,   25886,   25190,   13188,   19936, ...
  10 |  586590,  276144,  396642,  244233,  260505,  142550,  210663, ...
  11 | 3763290, 1948212, 3089010, 2167834, 2493489, 1476655, 2136586, ...
		

Crossrefs

Analogous for other patterns: A008302 (12), A138159 (321), A263771 (312), A342840 (1342), A342860 (2413), A342861 (1324), A342862 (2143), A342863 (1243), A342864 (1432).
Showing 1-9 of 9 results.