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.

Previous Showing 11-20 of 22 results. Next

A350015 Irregular triangle read by rows: T(n,k) is the number of n-permutations whose third-longest cycle has length exactly k; n >= 0, 0 <= k <= floor(n/3).

Original entry on oeis.org

1, 1, 2, 5, 1, 17, 7, 74, 46, 394, 311, 15, 2484, 2241, 315, 18108, 17627, 4585, 149904, 152839, 57897, 2240, 1389456, 1460944, 705600, 72800, 14257440, 15326180, 8673060, 1660120, 160460640, 175421214, 110271546, 31600800, 1247400, 1965444480, 2177730270, 1469308698, 559402272, 55135080
Offset: 0

Views

Author

Steven Finch, Dec 08 2021

Keywords

Comments

If the permutation has no third cycle, then its third-longest cycle is defined to have length 0.

Examples

			Triangle begins:
[0]      1;
[1]      1;
[2]      2;
[3]      5,      1;
[4]     17,      7;
[5]     74,     46;
[6]    394,    311,    15;
[7]   2484,   2241,   315;
[8]  18108,  17627,  4585;
[9] 149904, 152839, 57897, 2240;
...
		

Crossrefs

Column 0 gives 1 together with A000774.
Row sums give A000142.

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, x^l[1], add((j-1)!*
          b(n-j, sort([l[], j])[2..4])*binomial(n-1, j-1), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$3])):
    seq(lprint(T(n)), n=0..14);  # Alois P. Heinz, Dec 11 2021
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, x^l[[1]], Sum[(j - 1)!*b[n - j, Sort[Append[l, j]][[2 ;; 4]]]*Binomial[n - 1, j - 1], {j, 1, n}]];
    T[n_] := With[{p = b[n, {0, 0, 0}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Dec 28 2021, after Alois P. Heinz *)

Formula

Sum_{k=0..floor(n/3)} k * T(n,k) = A332852(n) for n >= 3. - Alois P. Heinz, Dec 12 2021

A350016 Irregular triangle read by rows: T(n,k) is the number of n-permutations whose third-shortest cycle has length exactly k; n >= 0, 0 <= k <= max(0,n-2).

Original entry on oeis.org

1, 1, 2, 5, 1, 17, 1, 6, 74, 11, 15, 20, 394, 56, 60, 120, 90, 2484, 407, 525, 490, 630, 504, 18108, 3235, 4725, 2240, 4620, 4032, 3360, 149904, 29143, 40509, 27440, 26460, 33264, 30240, 25920, 1389456, 291394, 398790, 319760, 163800, 302400, 277200, 259200, 226800
Offset: 0

Views

Author

Steven Finch, Dec 08 2021

Keywords

Comments

If the permutation has no third cycle, then its third-longest cycle is defined to have length 0.

Examples

			Triangle begins:
[0]      1;
[1]      1;
[2]      2;
[3]      5,     1;
[4]     17,     1,     6;
[5]     74,    11,    15,    20;
[6]    394,    56,    60,   120,    90;
[7]   2484,   407,   525,   490,   630,   504;
[8]  18108,  3235,  4725,  2240,  4620,  4032,  3360;
[9] 149904, 29143, 40509, 27440, 26460, 33264, 30240, 25920;
...
		

Crossrefs

Column 0 gives 1 together with A000774.
Column 1 gives the column 3 of A208956.
Row sums give A000142.

Programs

  • Maple
    m:= infinity:
    b:= proc(n, l) option remember; `if`(n=0, x^`if`(l[3]=m,
          0, l[3]), add(b(n-j, sort([l[], j])[1..3])
                   *binomial(n-1, j-1)*(j-1)!, j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [m$3])):
    seq(T(n), n=0..10);  # Alois P. Heinz, Dec 11 2021
  • Mathematica
    m = Infinity;
    b[n_, l_] := b[n, l] = If[n == 0, x^If[l[[3]] == m, 0, l[[3]]], Sum[b[n-j, Sort[Append[l, j]][[1;;3]]]*Binomial[n - 1, j - 1]*(j - 1)!, {j, 1, n}]];
    T[n_] := With[{p = b[n, {m, m, m}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, Dec 28 2021, after Alois P. Heinz *)

Formula

Sum_{k=0..n-2} k * T(n,k) = A332907(n) for n >= 3. - Alois P. Heinz, Dec 12 2021

A350273 Irregular triangle read by rows: T(n,k) is the number of n-permutations whose fourth-longest cycle has length exactly k; n >= 0, 0 <= k <= floor(n/4).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 109, 11, 619, 101, 4108, 932, 31240, 8975, 105, 268028, 91387, 3465, 2562156, 991674, 74970, 27011016, 11514394, 1391390, 311378616, 143188574, 24188010, 246400, 3897004032, 1905067958, 412136010, 12812800, 52626496896, 27059601596, 7053834788, 438357920
Offset: 0

Views

Author

Steven Finch, Dec 22 2021

Keywords

Comments

If the permutation has no fourth cycle, then its fourth-longest cycle is defined to have length 0.

Examples

			Triangle begins:
[0]      1;
[1]      1;
[2]      2;
[3]      6;
[4]     23,     1;
[5]    109,    11;
[6]    619,   101;
[7]   4108,   932;
[8]  31240,  8975,  105;
[9] 268028, 91387, 3465;
    ...
		

Crossrefs

Programs

  • Maple
    b:= proc(n, l) option remember; `if`(n=0, x^l[1], add((j-1)!*
          b(n-j, sort([l[], j])[2..5])*binomial(n-1, j-1), j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [0$4])):
    seq(T(n), n=0..14);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    b[n_, l_] := b[n, l] = If[n == 0, x^l[[1]], Sum[(j - 1)!*b[n - j, Sort[ Append[l, j]][[2 ;; 5]]]*Binomial[n - 1, j - 1], {j, 1, n}]];
    T[n_] := With[{p = b[n, {0, 0, 0, 0}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Dec 29 2021, after Alois P. Heinz *)

Formula

Sum_{k=0..floor(n/4)} k * T(n,k) = A332853(n) for n >= 4.

Extensions

More terms from Alois P. Heinz, Dec 22 2021

A350274 Triangle read by rows: T(n,k) is the number of n-permutations whose fourth-shortest cycle has length exactly k; n >= 0, 0 <= k <= max(0,n-3).

Original entry on oeis.org

1, 1, 2, 6, 23, 1, 109, 1, 10, 619, 16, 45, 40, 4108, 92, 210, 420, 210, 31240, 771, 1645, 2800, 2520, 1344, 268028, 6883, 17325, 15960, 26460, 18144, 10080, 2562156, 68914, 173250, 148400, 226800, 211680, 151200, 86400, 27011016, 757934, 1854930, 1798720, 1801800, 2494800, 1940400, 1425600, 831600
Offset: 0

Views

Author

Steven Finch, Dec 22 2021

Keywords

Comments

If the permutation has no fourth cycle, then its fourth-longest cycle is defined to have length 0.

Examples

			Triangle begins:
[0]      1;
[1]      1;
[2]      2;
[3]      6;
[4]     23,    1;
[5]    109,    1,    10;
[6]    619,   16,    45,    40;
[7]   4108,   92,   210,   420,   210;
[8]  31240,  771,  1645,  2800,  2520,  1344;
[9] 268028, 6883, 17325, 15960, 26460, 18144, 10080;
    ...
		

Crossrefs

Column 0 is 1 for n=0, together with A000142(n) - A122105(n-1) for n>=1.
Row sums give A000142.

Programs

  • Maple
    m:= infinity:
    b:= proc(n, l) option remember; `if`(n=0, x^`if`(l[4]=m,
          0, l[4]), add(b(n-j, sort([l[], j])[1..4])
                   *binomial(n-1, j-1)*(j-1)!, j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, [m$4])):
    seq(T(n), n=0..11);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    m = Infinity;
    b[n_, l_] := b[n, l] = If[n == 0, x^If[l[[4]] == m, 0, l[[4]]], Sum[b[n-j, Sort[Append[l, j]][[1 ;; 4]]]*Binomial[n-1, j-1]*(j-1)!, {j, 1, n}]];
    T[n_] := With[{p = b[n, {m, m, m, m}]}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]];
    Table[T[n], {n, 0, 11}] // Flatten (* Jean-François Alcover, Dec 29 2021, after Alois P. Heinz *)

Formula

Sum_{k=0..n-3} k * T(n,k) = A332908(n) for n >= 4.

Extensions

More terms from Alois P. Heinz, Dec 22 2021

A052145 a(n) = (2n-1)*(2n-1)!/n.

Original entry on oeis.org

1, 9, 200, 8820, 653184, 73180800, 11564467200, 2451889440000, 671854030848000, 231125690776780800, 97537253236899840000, 49549698749529538560000, 29829250083328819200000000, 20999962511521107738624000000, 17094073187896757112117657600000
Offset: 1

Views

Author

N. J. A. Sloane, Jan 23 2000

Keywords

Comments

This is the number of permutations of 2n letters having a cycle of length n. - Marko Riedel, Apr 21 2015

Examples

			For n=2, there are 9 permutations of [4] = { 1, 2, 3, 4 } which have a cycle of length 2: each of the 4*3/2 = 6 transpositions, plus the 3 different possible products of two transpositions. - _M. F. Hasler_, Apr 21 2015
		

References

  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see Problem 7.68(d).

Crossrefs

Programs

Formula

a(n) = 2*m*m!/(m+1) where m=2n-1.
a(n) = A126074(2n,n). - Alois P. Heinz, Apr 21 2017
a(n) = A293211(2n,n). - Alois P. Heinz, Oct 11 2017

A364967 Number T(n,k) of permutations of [n] for which the difference between the longest and the shortest cycle length is k; triangle T(n,k), n>=0, 0<=k<=max(0,n-2), read by rows.

Original entry on oeis.org

1, 1, 2, 3, 3, 10, 6, 8, 25, 45, 20, 30, 176, 60, 250, 90, 144, 721, 861, 770, 1344, 504, 840, 6406, 1778, 7980, 6300, 8736, 3360, 5760, 42561, 23283, 38808, 75348, 45360, 66240, 25920, 45360, 436402, 84150, 363680, 456120, 708048, 378000, 572400, 226800, 403200
Offset: 0

Views

Author

Alois P. Heinz, Aug 14 2023

Keywords

Comments

T(0,0) = 1 by convention.

Examples

			T(4,0) = 10: (1)(2)(3)(4), (12)(34), (13)(24), (14)(23), (1234), (1243), (1324), (1342), (1423), (1432).
T(4,1) = 6: (1)(2)(34), (1)(23)(4), (1)(24)(3), (12)(3)(4), (13)(2)(4), (14)(2)(3).
T(4,2) = 8: (1)(234), (1)(243), (123)(4), (132)(4), (124)(3), (142)(3), (134)(2), (143)(2).
Triangle T(n,k) begins:
      1;
      1;
      2;
      3,     3;
     10,     6,     8;
     25,    45,    20,    30;
    176,    60,   250,    90,   144;
    721,   861,   770,  1344,   504,   840;
   6406,  1778,  7980,  6300,  8736,  3360,  5760;
  42561, 23283, 38808, 75348, 45360, 66240, 25920, 45360;
  ...
		

Crossrefs

Row sums give A000142.
Column k=0 gives A005225 (for n>=1).
T(n+1,n-1) gives A001048(n) (for n>=1).

Programs

  • Maple
    b:= proc(n, l, m) option remember; `if`(n=0, x^(m-l), add(
         b(n-j, min(l, j), max(m, j))*binomial(n-1, j-1)*(j-1)!, j=1..n))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n$2, 0)):
    seq(T(n), n=0..12);
  • Mathematica
    b[n_, l_, m_] := b[n, l, m] = If[n == 0, x^(m - l), Sum[b[n - j, Min[l, j], Max[m, j]]*Binomial[n - 1, j - 1]*(j - 1)!, {j, 1, n}]];
    T[n_] := CoefficientList[b[n, n, 0], x];
    Table[T[n], {n, 0, 12}] // Flatten (* Jean-François Alcover, Dec 08 2023, after Alois P. Heinz *)

Formula

T(n,k) == 0 (mod k!).
Sum_{k=0..max(0,n-2)} T(n,k)/k! = A365229(n).

A271708 Triangle read by rows, T(n,k) = Sum_{p in P(n,k)} Aut(p) where P(n,k) are the partitions of n with largest part k and Aut(p) = 1^j[1]*j[1]!*...*n^j[n]*j[n]! where j[m] is the number of parts in the partition p equal to m; for n>=0 and 0<=k<=n.

Original entry on oeis.org

1, 0, 1, 0, 2, 2, 0, 6, 2, 3, 0, 24, 12, 3, 4, 0, 120, 20, 12, 4, 5, 0, 720, 112, 42, 16, 5, 6, 0, 5040, 336, 126, 44, 20, 6, 7, 0, 40320, 2112, 492, 188, 55, 24, 7, 8, 0, 362880, 11712, 2802, 640, 215, 66, 28, 8, 9, 0, 3628800, 92160, 16938, 3624, 830, 258, 77, 32, 9, 10
Offset: 0

Views

Author

Peter Luschny, Apr 17 2016

Keywords

Comments

Also T(n,k) = Sum_{p in P(n,k)} Cen(p) where Cen(p) is the size of the centralizer of any permutation of cycle type p.

Examples

			Triangle starts:
[1]
[0, 1]
[0, 2, 2]
[0, 6, 2, 3]
[0, 24, 12, 3, 4]
[0, 120, 20, 12, 4, 5]
[0, 720, 112, 42, 16, 5, 6]
[0, 5040, 336, 126, 44, 20, 6, 7]
[0, 40320, 2112, 492, 188, 55, 24, 7, 8]
		

Crossrefs

Cf. A110143 (row sums), A126074.

Programs

  • Sage
    def A271708(n,k):
        P = Partitions(n, max_part=k, inner=[k])
        return sum([p.aut() for p in P])
    for n in (0..9): print([A271708(n,k) for k in (0..n)])

A339016 A classification of permutations based on their cycle length and the size of the centralizer of their cycle type. Triangle read by rows, T(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 0, 2, 0, 0, 0, 6, 0, 0, 0, 3, 21, 0, 0, 0, 0, 35, 85, 0, 0, 0, 0, 55, 255, 410, 0, 0, 0, 0, 0, 1015, 1659, 2366, 0, 0, 0, 0, 0, 2485, 10528, 11242, 16065, 0, 0, 0, 0, 0, 2240, 58149, 92064, 84762, 125665, 0, 0, 0, 0, 0, 0, 228221, 760725, 805530, 722250, 1112074
Offset: 0

Views

Author

Peter Luschny, Nov 19 2020

Keywords

Comments

The size of the centralizer of a partition p is aut(p) = Product_{j = 1..k} m(j)!*j^m(j), where m(j) is the multiplicity of j as a part of p. (For instance p = [2, 2, 2] -> aut(p) = 3!*2^3.)
Let M be the matrix with M(k, r) = Sum_{p in P(n, k)} n! / aut(p) where P(n, k) are the partitions of n with largest part k and length(p) = r. Then T(n, k) = Sum_{j=0..k} M(j, k-j+1), which are the antidiagonal sums of the upper triangular part of the matrix M.
In the example section below it is explained how the matrix M leads to a two-dimensional classification of the permutations of [n] which project to the unsigned Stirling cycle numbers and the number of permutations with longest cycle length.

Examples

			Triangle starts:
0:  [1]
1:  [0, 1]
2:  [0, 0, 2]
3:  [0, 0, 0, 6]
4:  [0, 0, 0, 3,  21]
5:  [0, 0, 0, 0,  35,   85]
6:  [0, 0, 0, 0,  55,  255,     410]
7:  [0, 0, 0, 0,   0, 1015,    1659,  2366]
8:  [0, 0, 0, 0,   0, 2485,   10528, 11242, 16065]
9:  [0, 0, 0, 0,   0, 2240,   58149, 92064, 84762, 125665]
----------------------------------------------------------
Sum  1, 1, 2, 9, 111, 6080, 2331767, ...
.
Examples for the basic two-dimensional classification of permutations (dots indicate zeros):
.
* Case n = 6:
   |   1     2     3    4    5    6  | Sum
-------------------------------------|----
1  |   .     .     .    .    .   [1] |   1
2  |   .     .   [ 15] [45] [15]     |  75
3  |   .   [ 40] [120] [40]          | 200
4  |   .   [ 90] [ 90]               | 180
5  |   .   [144]                     | 144
6  | [120]                           | 120
-------------------------------------|----
Sum| 120,  274,   225,  85,  15,  1  | 720
.
Antidiagonals: [40 + 15, 90 + 120 + 45, 120 + 144 + 90 + 40 + 15 + 1]
Leads to row 6 (disregarding leading zeros): 55 + 255 + 410 = 720.
.
* Case n = 7:
   |  1      2     3     4     5    6    7  | Sum
--------------------------------------------|-----
1  |  .      .     .     .     .    .   [1] |    1
2  |  .      .     .   [105] [105] [21]     |  231
3  |  .      .   [490] [420] [ 70]          |  980
4  |  .    [420] [630] [210]                | 1260
5  |  .    [504] [504]                      | 1008
6  |  .    [840]                            |  840
7  | [720]                                  |  720
--------------------------------------------|-----
Sum| 720,  1764,  1624, 735,  175,  21,  1  | 5040
.
Antidiagonals: [420+490+105, 504+630+420+105, 720+840+504+210+70+21+1]
Leads to row 7 (disregarding leading zeros): 1015 + 1659 + 2366 = 5040
.
* Column sums of the matrix give the unsigned Stirling cycle numbers, A132393.
* Row sums of the matrix give the number of permutations of n elements whose longest cycle have length k, A126074.
* The main antidiagonal of the matrix gives the number of n-permutations that are pure cycles of length n - k, A092271.
* The entries of the matrix sum to n!. In particular the sum over all row sums, the sum over all column sums, and the sum over all antidiagonal sums is n!.
* The columns of the triangle are finite in the sense that their entries become ultimately zero. Column sums of the triangle are A339015.
		

Crossrefs

Cf. A000142 (row sums), A339015 (column sums), A132393, A126074, A092271, A121726, A339033, A006231, A002104.

Programs

  • SageMath
    # For illustration computes also A132393 and A126074 (remove the #).
    def A339016Row(n):
        f = factorial(n); M = matrix(n + 2)
        for k in (0..n):
            for p in Partitions(n, max_part=k, inner=[k]):
                M[k, len(p)] += (f // p.aut())
        # print("max cyc len", [sum(M[k, j] for j in (0..n+1)) for k in (0..n)])
        # print("Stirling 1 ", [sum(M[j, k] for j in (0..n+1)) for k in (0..n)])
        if n == 0: return [1]
        return [sum(M[j, k-j+1] for j in srange(k, 0, -1)) for k in (0..n)]
    for n in (0..9): print(A339016Row(n))

Formula

T(n, n) = A006231(n) + 1 = A002104(n) - (n-1) (after Franklin T. Adams-Watters in A121726).

A364317 Irregular triangle T read by rows: T(n, k) gives the number of permutations of [n] = {1, 2, ..., n} with a cycle of length m = floor(n/2) + k = A138099(n, k), for 1 <= k <= n - floor(n/2) = ceiling(n/2).

Original entry on oeis.org

1, 1, 3, 2, 8, 6, 40, 30, 24, 180, 144, 120, 1260, 1008, 840, 720, 8064, 6720, 5760, 5040, 72576, 60480, 51840, 45360, 40320, 604800, 518400, 453600, 403200, 362880, 6652800, 5702400, 4989600, 4435200, 3991680, 3628800
Offset: 1

Views

Author

Wolfdieter Lang, Aug 12 2023

Keywords

Comments

The length of row n is ceiling(n/2) = A008619(n-1).
The numbers for these cycles of permutations of [n], appear in the solution of the Locker Problem. See the link, p. 25.
For the probability of failures with the strategy used in the locker problem with n lockers and opening of up to floor(n/2) lockers see A058313(n)/A058312(n), for n > = 1. For n = 1 the one team member is not allowed to open the one locker (with the member's wallet) because (n/2) = 0; so certainly a failure.
For the probability of success in this locker problem for n lockers see A119248(n)/A058312(n), for n >= 1.

Examples

			The irregular triangle begins:
n\k       1       2       3       4       5       6 ...
-------------------------------------------------------
1:        1
2:        1
3:        3       2
4:        8       6
5:       40      30      24
6:      180     144     120
7:     1260    1008     840     720
8:     8064    6720    5760    5040
9:    72576   60480   51840   45360   40320
10:  604800  518400  453600  403200  362880
11: 6652800 5702400 4989600 4435200 3991680 3628800
...
T(5, 1) = 40 because m(5, 1) = 2 + 1 = 3, and for each of the binomial(5, 3) = 10 possibilities for choosing three numbers from [5] there are (3 - 1)! = 2 3-cycles if each starts with the smallest number, e.g., for {2, 3, 5} the cycles are (2, 3, 5) and (2, 5, 3). For the remaining 5-3 = 2 numbers there are 2! possible permutations; in the example permutations of {1, 4}, namely (1)(4) and (1,4). Thus T(5, 3) = binomial(5, 3)*2!*2! = 10*2*2 = 40 = 5!/3.
		

Crossrefs

Programs

Formula

T(n, k) = binomial(n, m(n, k))*(m(n, k) - 1)!*(n - m(n, k))! = n!/m(n, k), with m(n, k) = floor(n/2) + k = A138099(n, k), for n >= 1 and k = 1, 2, ..., ceiling(n/2).

A071007 Number of permutations in the symmetric group S_n such that the maximal cycle has length exactly 3.

Original entry on oeis.org

0, 0, 0, 2, 8, 40, 200, 980, 5152, 28448, 162080, 979000, 6179360, 40575392, 279199648, 1997406320, 14825619200, 114365751040, 912510870272, 7521873125408, 64045101880960, 561615674345600, 5067769601121920, 47023128008540992, 447820056115824128
Offset: 0

Views

Author

Sharon Sela (sharonsela(AT)hotmail.com), May 19 2002

Keywords

Comments

E.g.f.: exp( x + (x^2)/2 + (x^3)/3 ) - exp( x + (x^2)/2 ).

Crossrefs

Column k=3 of A126074.

Programs

  • Mathematica
    nn=20;Range[0,nn]!CoefficientList[Series[Exp[x+x^2/2+x^3/3]-Exp[x+x^2/2],{x,0,nn}],x]  (* Geoffrey Critzer, Jan 23 2013 *)
  • PARI
    for(n=0,25,print1(polcoeff(serlaplace(exp(x+x^2/2+x^3/3)-exp(x+x^2/2)),n)","))

Formula

a(n) = A057693(n) - A000085(n).

Extensions

More terms from Ralf Stephan, Apr 09 2003
Previous Showing 11-20 of 22 results. Next