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 *)
A286232
Sum T(n,k) of the entries in the k-th last 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, 5, 1, 19, 10, 1, 75, 57, 17, 1, 323, 285, 145, 26, 1, 1512, 1421, 975, 317, 37, 1, 7630, 7395, 5999, 2865, 616, 50, 1, 41245, 40726, 36183, 22411, 7315, 1094, 65, 1, 237573, 237759, 221689, 163488, 72581, 16630, 1812, 82, 1, 1451359, 1468162, 1405001, 1160764, 649723, 206249, 34425, 2840, 101, 1
Offset: 1
T(3,2) = 10 because the sum of the entries in the second last blocks of all set partitions of [3] (123, 12|3, 13|2, 1|23, 1|2|3) is 0+3+4+1+2 = 10.
Triangle T(n,k) begins:
1;
5, 1;
19, 10, 1;
75, 57, 17, 1;
323, 285, 145, 26, 1;
1512, 1421, 975, 317, 37, 1;
7630, 7395, 5999, 2865, 616, 50, 1;
41245, 40726, 36183, 22411, 7315, 1094, 65, 1;
...
-
app[P_, n_] := Module[{P0}, Table[P0 = Append[P, {}]; AppendTo[P0[[i]], n]; If[Last[P0] == {}, Most[P0], P0], {i, 1, Length[P]+1}]];
setPartitions[n_] := setPartitions[n] = If[n == 1, {{{1}}}, Flatten[app[#, n]& /@ setPartitions[n-1], 1]];
T[n_, k_] := Select[setPartitions[n], Length[#] >= k&][[All, -k]] // Flatten // Total;
Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* Jean-François Alcover, Aug 21 2021 *)
Showing 1-3 of 3 results.
Comments