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

A285362 Sum T(n,k) of the entries in the k-th blocks of all set partitions of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 15, 12, 3, 60, 58, 28, 4, 262, 273, 185, 55, 5, 1243, 1329, 1094, 495, 96, 6, 6358, 6839, 6293, 3757, 1148, 154, 7, 34835, 37423, 36619, 26421, 11122, 2380, 232, 8, 203307, 217606, 219931, 180482, 96454, 28975, 4518, 333, 9, 1257913, 1340597, 1376929, 1230737, 787959, 308127, 67898, 7995, 460, 10
Offset: 1

Views

Author

Alois P. Heinz, Apr 17 2017

Keywords

Examples

			T(3,2) = 12 because the sum of the entries in the second blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+2+5+2 = 12.
Triangle T(n,k) begins:
      1;
      4,     2;
     15,    12,     3;
     60,    58,    28,     4;
    262,   273,   185,    55,     5;
   1243,  1329,  1094,   495,    96,    6;
   6358,  6839,  6293,  3757,  1148,  154,   7;
  34835, 37423, 36619, 26421, 11122, 2380, 232, 8;
  ...
		

Crossrefs

Row sums give A000110(n) * A000217(n) = A105488(n+3).
Main diagonal and first lower diagonal give: A000027, A006000 (for n>0).
T(2n+1,n+1) gives A285410.

Programs

  • Maple
    T:= proc(h) option remember; local b; b:=
          proc(n, m) option remember; `if`(n=0, [1, 0], add((p-> p
            +[0, (h-n+1)*p[1]*x^j])(b(n-1, max(m, j))), j=1..m+1))
          end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, 0)[2])
        end:
    seq(T(n), n=1..12);
  • Mathematica
    T[h_] := T[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[# + {0, (h - n + 1)*#[[1]]*x^j}&[b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, 0][[2]]]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Apr 30 2018, after Alois P. Heinz *)

A185105 Number T(n,k) of entries in the k-th cycles of all permutations of {1,2,..,n}; each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Original entry on oeis.org

1, 3, 1, 12, 5, 1, 60, 27, 8, 1, 360, 168, 59, 12, 1, 2520, 1200, 463, 119, 17, 1, 20160, 9720, 3978, 1177, 221, 23, 1, 181440, 88200, 37566, 12217, 2724, 382, 30, 1, 1814400, 887040, 388728, 135302, 34009, 5780, 622, 38, 1, 19958400, 9797760, 4385592, 1606446, 441383, 86029, 11378, 964, 47, 1
Offset: 1

Views

Author

Wouter Meeussen, Dec 26 2012

Keywords

Comments

Row sums are n!*n = A001563(n) (see example).
For fixed k>=1, A185105(n,k) ~ n!*n/2^k. - Vaclav Kotesovec, Apr 25 2017

Examples

			The six permutations of n=3 in ordered cycle form are:
{ {1}, {2}, {3}    }
{ {1}, {2, 3}, {}  }
{ {1, 2}, {3}, {}  }
{ {1, 2, 3}, {}, {}}
{ {1, 3, 2}, {}, {}}
{ {1, 3}, {2}, {}  }
.
The lengths of the cycles in position k=1 sum to 12, those of the cycles in position k=2 sum to 5 and those of the cycles in position k=3 sum to 1.
Triangle begins:
       1;
       3,     1;
      12,     5,     1;
      60,    27,     8,     1;
     360,   168,    59,    12,    1;
    2520,  1200,   463,   119,   17,   1;
   20160,  9720,  3978,  1177,  221,  23,  1;
  181440, 88200, 37566, 12217, 2724, 382, 30, 1;
  ...
		

Crossrefs

Columns k=1-10 give: A001710(n+1), A138772, A159324(n-1)/2 or A285231, A285232, A285233, A285234, A285235, A285236, A285237, A285238.
T(2n,n) gives A285239.

Programs

  • Maple
    b:= proc(n, i) option remember; expand(`if`(n=0, 1,
          add((p-> p+coeff(p, x, 0)*j*x^i)(b(n-j, i+1))*
           binomial(n-1, j-1)*(j-1)!, j=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 1)):
    seq(T(n), n=1..12);  # Alois P. Heinz, Apr 15 2017
  • Mathematica
    Table[it = Join[RotateRight /@ ToCycles[#], Table[{}, {k}]] & /@ Permutations[Range[n]]; Tr[Length[Part[#, k]]& /@ it], {n, 7}, {k, n}]
    (* Second program: *)
    b[n_, i_] := b[n, i] = Expand[If[n==0, 1, Sum[Function[p, p + Coefficient[ p, x, 0]*j*x^i][b[n-j, i+1]]*Binomial[n-1, j-1]*(j-1)!, {j, 1, n}]]];
    T[n_] := Function[p, Table[Coefficient[p, x, i], {i, 1, n}]][b[n, 1]];
    Array[T, 12] // Flatten (* Jean-François Alcover, May 30 2018, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Apr 15 2017

A180119 a(n) = (n+2)! * Sum_{k = 1..n} 1/((k+1)*(k+2)).

Original entry on oeis.org

0, 1, 6, 36, 240, 1800, 15120, 141120, 1451520, 16329600, 199584000, 2634508800, 37362124800, 566658892800, 9153720576000, 156920924160000, 2845499424768000, 54420176498688000, 1094805903679488000, 23112569077678080000, 510909421717094400000, 11802007641664880640000
Offset: 0

Views

Author

Gary Detlefs, Aug 10 2010

Keywords

Comments

In general, a sequence of the form (n+x+2)! * Sum_{k = 1..n} (k+x)!/(k+x+2)! will have a closed form of (n+x+2)!*n/((x+2)*(n+2+x)).
0 followed by A001286. - R. J. Mathar, Aug 13 2010
Sum of the entries in all cycles of all permutations of [n]. - Alois P. Heinz, Apr 19 2017

Crossrefs

Programs

  • Magma
    [n*Factorial(n+2)/(2*(n+2)): n in [0..25]]; // Vincenzo Librandi, Feb 20 2017
  • Maple
    a:= n-> n*(n+2)!/(2*(n+2)): seq(a(n), n=0..20);
  • Mathematica
    Table[n (n + 2)! / (2 (n + 2)), {n, 0, 30}] (* Vincenzo Librandi, Feb 20 2017 *)
  • PARI
    a(n) = (n+2)! * sum(k=1, n,1/((k+1)*(k+2))); \\ Michel Marcus, Jan 10 2015
    
  • PARI
    apply( A180119(n)=(n+1)!\2*n, [0..20]) \\ M. F. Hasler, Apr 10 2018
    

Formula

a(n) = n*(n+1)!/2. [Simplified by M. F. Hasler, Apr 10 2018]
a(n) = (n+1)! * Sum_{k = 2..n} (1/(k^2+k)), with offset 1. - Gary Detlefs, Sep 15 2011
a(n) = Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*k^(n+1) = (1/(2*x + 1))*Sum_{k = 0..n} (-1)^(n-k)*binomial(n,k)*(x*n + k)^(n+1), for arbitrary x != -1/2. - Peter Bala, Feb 19 2017
From Alois P. Heinz, Apr 19 2017: (Start)
a(n) = A000142(n) * A000217(n) = Sum_{k=1..n} A285439(n,k).
E.g.f.: x/(1-x)^3. (End)
a(n) = A001286(n+1) for n > 0. - M. F. Hasler, Apr 10 2018

A285793 Sum T(n,k) of the k-th entries in all cycles of all permutations of [n]; triangle T(n,k), n>=1, 1<=k<=n, read by rows.

Original entry on oeis.org

1, 4, 2, 18, 13, 5, 96, 83, 43, 18, 600, 582, 342, 192, 84, 4320, 4554, 2874, 1824, 1068, 480, 35280, 39672, 26232, 17832, 11784, 7080, 3240, 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200, 3265920, 4044240, 2834640, 2078640, 1534320, 1110960, 765360, 473760, 221760
Offset: 1

Views

Author

Alois P. Heinz, Apr 26 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			T(3,2) = 13 because the sum of the second entries in all cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 2+3+2+3+3+0 = 13.
Triangle T(n,k) begins:
:      1;
:      4,      2;
:     18,     13,      5;
:     96,     83,     43,     18;
:    600,    582,    342,    192,     84;
:   4320,   4554,   2874,   1824,   1068,   480;
:  35280,  39672,  26232,  17832,  11784,  7080,  3240;
: 322560, 382248, 261288, 185688, 131256, 88920, 54360, 25200;
		

Crossrefs

Columns k=1-2 give: A001563, A285795.
Main diagonal and first lower diagonal give: A038720(n-1) (for n>1), A286175.
Row sums give A000142 * A000217 = A180119.

Formula

T(n,1) = n * n!.
T(n,n) = floor((n-1)!*(n+2)/2).

A284816 Sum of entries in the first cycles of all permutations of [n].

Original entry on oeis.org

1, 4, 21, 132, 960, 7920, 73080, 745920, 8346240, 101606400, 1337212800, 18920563200, 286442956800, 4620449433600, 79114299264000, 1433211107328000, 27387931963392000, 550604138692608000, 11617107089043456000, 256671161862635520000, 5926549291918295040000
Offset: 1

Views

Author

Alois P. Heinz, Apr 15 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.
Also, the number of colorings of n+1 given balls, two thereof identical, using n given colors (each color is used). - Ivaylo Kortezov, Jan 27 2024

Examples

			a(3) = 21 because the sum of the entries in the first cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+4+1+1 = 21.
		

Crossrefs

Column k=1 of A285439.

Programs

  • Maple
    a:= n-> n!*(n*(n+1)-(n-1)*(n+2)/2)/2:
    seq(a(n), n=1..25);
    # second Maple program:
    a:= proc(n) option remember; `if`(n<2, n,
           (n^2+n+2)*n*a(n-1)/(n^2-n+2))
        end:
    seq(a(n), n=1..25);

Formula

a(n) = n!*(n*(n+1) - (n-1)*(n+2)/2)/2.
E.g.f.: -x*(x^2-2*x+2)/(2*(x-1)^3).
a(n) = (n^2+n+2)*n*a(n-1)/(n^2-n+2) for n > 1, a(n) = n for n < 2.
a(n) = n*A006595(n-1). - Ivaylo Kortezov, Feb 02 2024

A285382 Sum of entries in the last cycles of all permutations of [n].

Original entry on oeis.org

1, 5, 25, 143, 942, 7074, 59832, 563688, 5858640, 66622320, 823055040, 10979133120, 157300375680, 2409321801600, 39290164300800, 679701862425600, 12433400027596800, 239791474805299200, 4863054420016128000, 103462238924835840000, 2304147629440419840000
Offset: 1

Views

Author

Alois P. Heinz, Apr 20 2017

Keywords

Comments

Each cycle is written with the smallest element first and cycles are arranged in increasing order of their first elements.

Examples

			a(3) = 25 because the sum of the entries in the last cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 6+6+3+2+5+3 = 25.
		

Crossrefs

Column k=1 of A286231.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, n*(3*n-1)/2,
         ((2*n^2+3*n-1)*a(n-1)-(n+2)*(n-1)*n*a(n-2))/(n+1))
        end:
    seq(a(n), n=1..25);
  • Mathematica
    Table[n! * (n-1 + 2*(n+1)*HarmonicNumber[n])/4, {n, 1, 25}] (* Vaclav Kotesovec, Apr 29 2017 *)

Formula

Recursion: see Maple program.

A285489 Sum of entries in the second cycles of all permutations of [n].

Original entry on oeis.org

2, 12, 76, 545, 4422, 40194, 405072, 4484808, 54121680, 707105520, 9944043840, 149769846720, 2405254884480, 41029304803200, 740857462732800, 14117363667993600, 283111532808652800, 5960312380873267200, 131434781395405824000, 3029635129259289600000
Offset: 2

Views

Author

Alois P. Heinz, Apr 19 2017

Keywords

Examples

			a(3) = 12 because the sum of the entries in the second cycles of all permutations of [3] ((123), (132), (12)(3), (13)(2), (1)(23), (1)(2)(3)) is 0+0+3+2+5+2 = 12.
		

Crossrefs

Column k=2 of A285439.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<3, (n-1)*n,
          ((2*n^3-7*n^2+11*n-8)*n*a(n-1)-(n-1)*(n-2)
          *(n^2-n+2)*n*a(n-2))/((n^2-3*n+4)*(n-1)))
        end:
    seq(a(n), n=2..25);
  • Mathematica
    a[2] = 2; a[3] = 12; a[n_] := a[n] = ((2n^3 - 7n^2 + 11n - 8) n a[n-1] - (n-1)(n-2)(n^2 - n + 2) n a[n-2])/((n^2 - 3n + 4)(n-1));
    Table[a[n], {n, 2, 25}] (* Jean-François Alcover, Jun 01 2018, from Maple *)

Formula

Recursion: see Maple program.
E.g.f.: x*(x*(x-2)+2*(x-1)^2*log(1-x))/(4*(x-1)^3).
a(n) ~ n! * n^2 / 8. - Vaclav Kotesovec, Apr 20 2017
Showing 1-7 of 7 results.