%I #19 Feb 18 2015 03:42:34
%S 1,1,1,2,1,2,5,2,3,5,15,5,8,10,15,53,15,26,32,38,53,217,53,99,122,142,
%T 164,217,1014,217,433,537,619,704,797,1014,5335,1014,2143,2683,3069,
%U 3464,3876,4321,5335,31240,5335,11854,15015,17063,19140,21294,23522,25905,31240
%N Triangle read by rows: T(n,k) is the number of ascent sequences of length n with last zero at position k-1.
%C Row sums are A022493.
%C First column and the diagonal is A022493(n-1).
%H Alois P. Heinz, <a href="/A218579/b218579.txt">Rows n = 1..100, flattened</a>
%e Triangle starts:
%e [ 1] 1;
%e [ 2] 1, 1;
%e [ 3] 2, 1, 2;
%e [ 4] 5, 2, 3, 5;
%e [ 5] 15, 5, 8, 10, 15;
%e [ 6] 53, 15, 26, 32, 38, 53;
%e [ 7] 217, 53, 99, 122, 142, 164, 217;
%e [ 8] 1014, 217, 433, 537, 619, 704, 797, 1014;
%e [ 9] 5335, 1014, 2143, 2683, 3069, 3464, 3876, 4321, 5335;
%e [10] 31240, 5335, 11854, 15015, 17063, 19140, 21294, 23522, 25905, 31240;
%e ...
%p b:= proc(n, i, t, k) option remember; `if`(n=0, 1,
%p add(b(n-1, j, t+`if`(j>i, 1, 0), max(-1, k-1)),
%p j=`if`(k>=0, 0, 1)..`if`(k=0, 0, t+1)))
%p end:
%p T:= (n, k)-> b(n-1, 0, 0, k-2):
%p seq(seq(T(n,k), k=1..n), n=1..10); # _Alois P. Heinz_, Nov 16 2012
%t b[n_, i_, t_, k_] := b[n, i, t, k] = If[n == 0, 1, Sum[b[n-1, j, t + If[j>i, 1, 0], Max[-1, k-1]], {j, If[k >= 0, 0, 1], If[k == 0, 0, t+1]}]]; T[n_, k_] := b[n-1, 0, 0, k-2]; Table[Table[T[n, k], {k, 1, n}], {n, 1, 10}] // Flatten (* _Jean-François Alcover_, Feb 18 2015, after _Alois P. Heinz_ *)
%Y Cf. A022493 (number of ascent sequences).
%Y Cf. A218580 (ascent sequences with first occurrence of the maximal value at position k-1), A218581 (ascent sequences with last occurrence of the maximal value at position k-1).
%Y Cf. A137251 (ascent sequences with k ascents), A218577 (ascent sequences with maximal element k), A175579 (ascent sequences with k zeros).
%K nonn,tabl
%O 1,4
%A _Joerg Arndt_, Nov 03 2012