%I #17 Jul 10 2019 10:39:33
%S 1,2,3,3,8,10,4,15,30,35,5,24,63,112,126,6,35,112,252,420,462,7,48,
%T 180,480,990,1584,1716,8,63,270,825,1980,3861,6006,6435,9,80,385,1320,
%U 3575,8008,15015,22880,24310,10,99,528,2002,6006,15015,32032,58344,87516,92378
%N Subtriangle of the generalized ballot numbers, T(n,k) = A238762(2*k-1,2*n-1), 1<=k<=n, read by rows.
%F T(n,n) = A001700(n-1).
%F T(n,n-1) = A162551(n-1).
%e [n\k 1 2 3 4 5 6 7 ]
%e [1] 1,
%e [2] 2, 3,
%e [3] 3, 8, 10,
%e [4] 4, 15, 30, 35,
%e [5] 5, 24, 63, 112, 126,
%e [6] 6, 35, 112, 252, 420, 462,
%e [7] 7, 48, 180, 480, 990, 1584, 1716.
%p binom2 := proc(n, k) local h;
%p h := n -> (n-((1-(-1)^n)/2))/2;
%p n!/(h(n-k)!*h(n+k)!) end:
%p A238761 := (n, k) -> binom2(n+k, n-k+1)*(n-k+1)/(n+k):
%p seq(print(seq(A238761(n, k), k=1..n)), n=1..7);
%t h[n_] := (n - ((1 - (-1)^n)/2))/2;
%t binom2[n_, k_] := n!/(h[n-k]! h[n+k]!);
%t T[n_, k_] := binom2[n+k, n-k+1] (n-k+1)/(n+k);
%t Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten (* _Jean-François Alcover_, Jul 10 2019, from Maple *)
%o (Sage)
%o @CachedFunction
%o def ballot(p, q):
%o if p == 0 and q == 0: return 1
%o if p < 0 or p > q: return 0
%o S = ballot(p-2, q) + ballot(p, q-2)
%o if q % 2 == 1: S += ballot(p-1, q-1)
%o return S
%o A238761 = lambda n, k: ballot(2*k-1, 2*n-1)
%o for n in (1..7): [A238761(n, k) for k in (1..n)]
%Y Row sums are A002054.
%Y Cf. A001700, A009766.
%K nonn,tabl
%O 1,2
%A _Peter Luschny_, Mar 05 2014