A321273
Sum over all permutations of [n] of the maximum of the lengths of increasing or decreasing subsequences.
Original entry on oeis.org
1, 4, 14, 70, 396, 2628, 20270, 175392, 1686374, 17920528, 208454628, 2629931688, 35774761662, 522351495684, 8149929922408, 135284126840592, 2380119357533974, 44243729657494640, 866599471539160876, 17839886344238238784, 385065445154671172880, 8695565142604747421416
Offset: 1
-
h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
f:= l-> h(l)^2*max(l[1], nops(l)):
g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
a:= n-> g(n$2, []):
seq(a(n), n=1..23);
-
h[l_] := Function[n, Total[l]!/Product[Product[1 + l[[i]] - j + Sum[If[j > l[[k]], 0, 1], {k, i + 1, n}], {j, 1, l[[i]]}], {i, 1, n}]][Length[l]];
f[l_] := h[l]^2 Max[l[[1]], Length[l]];
g[n_, i_, l_] := If[n == 0 || i == 1, f[Join[l, Table[1, {n}]]], g[n, i - 1, l] + g[n - i, Min[i, n - i], Append[l, i]]];
a[n_] := g[n, n, {}];
Table[a[n], {n, 1, 23}] (* Jean-François Alcover, Oct 31 2021, after Alois P. Heinz *)
A321274
Sum over all permutations of [n] of the minimum of the lengths of longest increasing subsequence and longest decreasing subsequence.
Original entry on oeis.org
1, 2, 10, 46, 274, 1894, 14660, 128648, 1259740, 13540882, 158689006, 2018664332, 27699652406, 407457326286, 6395402111042, 106731605965344, 1887716456363316, 35269257369001618, 694027051724655398, 14346767204627002964, 310852440258761877068, 7045172291061429434354
Offset: 1
-
h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
f:= l-> h(l)^2*min(l[1], nops(l)):
g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
a:= n-> g(n$2, []):
seq(a(n), n=1..23);
A321277
One half of the sum over all permutations of [n] of the absolute difference between the length of the longest increasing subsequence and the length of the longest decreasing subsequence.
Original entry on oeis.org
0, 1, 2, 12, 61, 367, 2805, 23372, 213317, 2189823, 24882811, 305633678, 4037554628, 57447084699, 877263905683, 14276260437624, 246201450585329, 4487236144246511, 86286209907252739, 1746559569805617910, 37106502447954647906, 825196425771658993531
Offset: 1
-
h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
f:= l-> h(l)^2*abs(l[1]-nops(l))/2:
g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
a:= n-> g(n$2, []):
seq(a(n), n=1..23);
A321278
One half of the sum over all permutations of [n] of the squared difference between the length of the longest increasing subsequence and the length of the longest decreasing subsequence.
Original entry on oeis.org
0, 1, 4, 18, 105, 699, 5285, 45128, 431223, 4540775, 52268029, 653096124, 8810538490, 127622293057, 1975379879871, 32537074533872, 568268861724191, 10490690233451583, 204118868130889733, 4174977363687339452, 89554055679215605982, 2010207472655266461533
Offset: 1
-
h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
f:= l-> h(l)^2*(l[1]-nops(l))^2/2:
g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
a:= n-> g(n$2, []):
seq(a(n), n=1..23);
A321276
Sum over all permutations of [n] of the length of the longest increasing subsequence raised to the power of the length of the longest decreasing subsequence.
Original entry on oeis.org
1, 3, 20, 174, 1915, 25861, 407691, 7330188, 148016449, 3312032213, 81207824255, 2162810487154, 62125097028962, 1913156511113517, 62839800627095263, 2191735865280260976, 80859575674731497805, 3144804693463679033629, 128550453029684197431607
Offset: 1
-
h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
f:= l-> h(l)^2*l[1]^nops(l):
g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
a:= n-> g(n$2, []):
seq(a(n), n=1..23);
Showing 1-5 of 5 results.