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.

A321314 Number of permutations of [n] where the length of the longest increasing subsequence is larger than the length of the longest decreasing subsequence.

This page as a plain text file.
%I A321314 #21 Aug 31 2021 14:35:39
%S A321314 0,1,1,10,42,232,1879,15228,131452,1329136,15106976,182954700,
%T A321314 2363478435,33096395494,501248446126,8094778608472,138112754890488,
%U A321314 2487454752219208,47344572399516136,950682668010605104,20055050996527350752,442701537970743308588,10202898078512473893032
%N A321314 Number of permutations of [n] where the length of the longest increasing subsequence is larger than the length of the longest decreasing subsequence.
%H A321314 Alois P. Heinz, <a href="/A321314/b321314.txt">Table of n, a(n) for n = 1..80</a>
%H A321314 Wikipedia, <a href="https://en.wikipedia.org/wiki/Longest_increasing_subsequence">Longest increasing subsequence</a>
%F A321314 a(n) = Sum_{k=1..n-1} A321316(n,k).
%F A321314 a(n) = (n! - A321313(n))/2.
%F A321314 a(n) = A321315(n) - A321313(n).
%p A321314 h:= l-> (n-> add(i, i=l)!/mul(mul(1+l[i]-j+add(`if`(j>
%p A321314     l[k], 0, 1), k=i+1..n), j=1..l[i]), i=1..n))(nops(l)):
%p A321314 f:= l-> `if`(l[1]<nops(l), h(l)^2, 0):
%p A321314 g:= (n, i, l)-> `if`(n=0 or i=1, f([l[], 1$n]),
%p A321314      g(n, i-1, l) +g(n-i, min(i, n-i), [l[], i])):
%p A321314 a:= n-> g(n$2, []):
%p A321314 seq(a(n), n=1..23);
%t A321314 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}]];
%t A321314 f[l_] := If[l[[1]] < Length[l], h[l]^2, 0];
%t A321314 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]]];
%t A321314 a[n_] := g[n, n, {}];
%t A321314 Array[a, 25] (* _Jean-François Alcover_, Aug 31 2021, after _Alois P. Heinz_ *)
%Y A321314 Cf. A000142, A003316, A321313, A321315, A321316.
%K A321314 nonn
%O A321314 1,4
%A A321314 _Alois P. Heinz_, Nov 03 2018