%I #16 Mar 14 2021 11:42:56
%S 1,1,2,1,5,8,5,1,16,50,79,69,34,9,1,65,314,872,1539,1823,1494,856,339,
%T 89,14,1,326,2142,8799,24818,50561,76944,89546,80938,57284,31771,
%U 13707,4520,1103,188,20,1,1957,16248,89273,355271,1070455,2514044,4705648
%N Number T(n,k) of permutations p of [n] such that k is the maximum of the partial sums of the signed up-down jump sequence of 0,p; triangle T(n,k), k>=0, k<=n<=k*(k+1)/2, read by columns.
%C An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump -j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.
%H Alois P. Heinz, <a href="/A316293/b316293.txt">Columns k = 0..40, flattened</a>
%e Triangle T(n,k) begins:
%e : 1;
%e : 1;
%e : 2;
%e : 1, 5;
%e : 8, 16;
%e : 5, 50, 65;
%e : 1, 79, 314, 326;
%e : 69, 872, 2142, 1957;
%e : 34, 1539, 8799, 16248, 13700;
%e : 9, 1823, 24818, 89273, 137356, 109601;
%e : 1, 1494, 50561, 355271, 947713, 1287350, 986410;
%p b:= proc(u, o, c, k) option remember;
%p `if`(c>k, 0, `if`(u+o=0, 1,
%p add(b(u-j, o-1+j, c+j, k), j=1..u)+
%p add(b(u+j-1, o-j, c-j, k), j=1..o)))
%p end:
%p T:= (n, k)-> b(n, 0$2, k) -`if`(k=0, 0, b(n, 0$2, k-1)):
%p seq(seq(T(n, k), n=k..k*(k+1)/2), k=0..8);
%t b[u_, o_, c_, k_] := b[u, o, c, k] = If[c > k, 0, If[u + o == 0, 1,
%t Sum[b[u - j, o - 1 + j, c + j, k], {j, 1, u}] +
%t Sum[b[u + j - 1, o - j, c - j, k], {j, 1, o}]]];
%t T[n_, k_] := b[n, 0, 0, k] - If[k == 0, 0, b[n, 0, 0, k - 1]];
%t Table[Table[T[n, k], {n, k, k(k+1)/2}], {k, 0, 8}] // Flatten (* _Jean-François Alcover_, Mar 14 2021, after _Alois P. Heinz_ *)
%Y Row sums give A000142.
%Y Column sums give A316294.
%Y Main diagonal gives A000522.
%Y Cf. A000217, A258829, A291722, A303697, A316292 (same read by rows).
%K nonn,tabf
%O 0,3
%A _Alois P. Heinz_, Jun 28 2018