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
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;
...
-
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
-
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 *)
A285439
Sum T(n,k) of the entries in the k-th 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, 21, 12, 3, 132, 76, 28, 4, 960, 545, 235, 55, 5, 7920, 4422, 2064, 612, 96, 6, 73080, 40194, 19607, 6692, 1386, 154, 7, 745920, 405072, 202792, 75944, 18736, 2816, 232, 8, 8346240, 4484808, 2280834, 911637, 254061, 46422, 5256, 333, 9
Offset: 1
T(3,1) = 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.
Triangle T(n,k) begins:
1;
4, 2;
21, 12, 3;
132, 76, 28, 4;
960, 545, 235, 55, 5;
7920, 4422, 2064, 612, 96, 6;
73080, 40194, 19607, 6692, 1386, 154, 7;
745920, 405072, 202792, 75944, 18736, 2816, 232, 8;
...
Main diagonal and first lower diagonal give:
A000027,
A006000 (for n>0).
-
T:= proc(h) option remember; local b; b:=
proc(n, l) option remember; `if`(n=0, [mul((i-1)!, i=l), 0],
(p-> p+[0, (h-n+1)*p[1]*x^(nops(l)+1)])(b(n-1, [l[], 1]))+
add((p-> p+[0, (h-n+1)*p[1]*x^j])(
b(n-1, subsop(j=l[j]+1, l))), j=1..nops(l)))
end: (p-> seq(coeff(p, x, i), i=1..n))(b(h, [])[2])
end:
seq(T(n), n=1..10);
-
T[h_] := T[h] = Module[{b}, b[n_, l_] := b[n, l] = If[n == 0, {Product[(i - 1)!, {i, l}], 0}, # + {0, (h - n + 1)*#[[1]]*x^(Length[l] + 1)}&[b[n - 1, Append[l, 1]]] + Sum[# + {0, (h-n+1)*#[[1]]*x^j}&[b[n - 1, ReplacePart[ l, j -> l[[j]] + 1]]], {j, 1, Length[l]}]]; Table[Coefficient[#, x, i], {i, 1, n}]&[b[h, {}][[2]]]];
Table[T[n], {n, 1, 10}] // Flatten (* Jean-François Alcover, May 25 2018, translated from Maple *)
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
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.
-
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);
-
Table[n! * (n-1 + 2*(n+1)*HarmonicNumber[n])/4, {n, 1, 25}] (* Vaclav Kotesovec, Apr 29 2017 *)
A285363
Sum of the entries in the first blocks of all set partitions of [n].
Original entry on oeis.org
1, 4, 15, 60, 262, 1243, 6358, 34835, 203307, 1257913, 8216945, 56463487, 406868167, 3065920770, 24099977863, 197179545722, 1675846476148, 14769104672839, 134745258569108, 1270767279092285, 12371426210292311, 124173909409948575, 1283498833928098171
Offset: 1
a(3) = 15 because the sum of the entries in the first blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 6+3+4+1+1 = 15.
-
a:= proc(h) option remember; local b; b:=
proc(n, m) option remember;
`if`(n=0, [1, 0], add((p-> `if`(j=1, p+ [0,
(h-n+1)*p[1]], p))(b(n-1, max(m, j))), j=1..m+1))
end: b(h, 0)[2]
end:
seq(a(n), n=1..30);
-
a[h_] := a[h] = Module[{b}, b[n_, m_] := b[n, m] = If[n == 0, {1, 0}, Sum[If[j == 1, # + {0, (h - n + 1)*#[[1]]}, #]&[b[n - 1, Max[m, j]]], {j, 1, m + 1}]]; b[h, 0][[2]]];
Table[a[n], {n, 1, 30}] (* Jean-François Alcover, May 20 2018, translated from Maple *)
A369810
Number of ways to color n+1 identical balls using n distinct colors (each color is used) and place them in n numbered cells so that each cell contains at least one ball.
Original entry on oeis.org
1, 8, 63, 528, 4800, 47520, 511560, 5967360, 75116160, 1016064000, 14709340800, 227046758400, 3723758438400, 64686292070400, 1186714488960000, 22931377717248000, 465594843377664000, 9910874496466944000, 220725034691825664000, 5133423237252710400000
Offset: 1
For n=3 one of the colors c (3 choices) is used twice and one of the cells k (3 choices) gets two balls. If the cell k does not contain a c-colored ball, then all other cells do (1 variant). If the cell k contains a c-colored ball, after its removal there are 3!=6 variants for placing the remaining 3 different balls in the 3 cells. In total there are 3*3*(1+6)=63 variants.
Showing 1-5 of 5 results.
Comments