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);
A321316
Number T(n,k) of permutations of [n] whose difference between the length of the longest increasing subsequence and the length of the longest decreasing subsequence equals k; triangle T(n,k), n >= 1, 1-n <= k <= n-1, read by rows.
Original entry on oeis.org
1, 1, 0, 1, 1, 0, 4, 0, 1, 1, 0, 9, 4, 9, 0, 1, 1, 0, 16, 25, 36, 25, 16, 0, 1, 1, 0, 25, 81, 125, 256, 125, 81, 25, 0, 1, 1, 0, 36, 196, 421, 1225, 1282, 1225, 421, 196, 36, 0, 1, 1, 0, 49, 400, 1225, 4292, 9261, 9864, 9261, 4292, 1225, 400, 49, 0, 1
Offset: 1
: 1 ;
: 1, 0, 1 ;
: 1, 0, 4, 0, 1 ;
: 1, 0, 9, 4, 9, 0, 1 ;
: 1, 0, 16, 25, 36, 25, 16, 0, 1 ;
: 1, 0, 25, 81, 125, 256, 125, 81, 25, 0, 1 ;
: 1, 0, 36, 196, 421, 1225, 1282, 1225, 421, 196, 36, 0, 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*x^(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])):
b:= proc(n) option remember; g(n$2, []) end:
T:= (n, k)-> coeff(b(n), x, k):
seq(seq(T(n, k), k=1-n..n-1), n=1..10);
-
h[l_] := With[{n = Length[l]}, 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}]];
f[l_] := h[l]^2*x^(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]]];
b[n_] := b[n] = g[n, n, {}];
T[n_, k_] := Coefficient[b[n], x, k];
Table[Table[T[n, k], {k, 1 - n, n - 1}], {n, 1, 10}] // Flatten (* Jean-François Alcover, Feb 27 2021, after Alois P. Heinz *)
A321275
Sum over all permutations of [n] of the product of the lengths of longest increasing subsequence and longest decreasing subsequence.
Original entry on oeis.org
1, 4, 22, 132, 890, 6812, 58422, 555900, 5819658, 66554180, 825839718, 11054124886, 158795559000, 2437248222710, 39809464449676, 689538524084168, 12625142440334342, 243656361772961292, 4943801229819987022, 105212500452414418118, 2343513475564027153128
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);
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-6 of 6 results.