login
T(n, k) = binomial(2*n - 1 - k, k - 1)*hypergeom([2, 2, 1-k], [1, 1 - 2*k + 2*n], -1), triangle read by rows, T(n, k) for n >= 1 and 1 <= k <= n.
2

%I #27 Jan 01 2024 15:31:06

%S 1,1,5,1,7,18,1,9,31,56,1,11,48,111,160,1,13,69,198,351,432,1,15,94,

%T 325,699,1023,1120,1,17,123,500,1280,2223,2815,2816,1,19,156,731,2186,

%U 4458,6562,7423,6912,1,21,193,1026,3525,8330,14198,18324,18943,16640

%N T(n, k) = binomial(2*n - 1 - k, k - 1)*hypergeom([2, 2, 1-k], [1, 1 - 2*k + 2*n], -1), triangle read by rows, T(n, k) for n >= 1 and 1 <= k <= n.

%H Andrew Howroyd, <a href="/A320905/b320905.txt">Table of n, a(n) for n = 1..1275</a> (rows 1..50)

%F T(n, k) = Sum_{j=0..2*n-k} binomial(2*n-k, 2*n - 2*k + 1 + j)*binomial(j+2, 2). - _Detlef Meya_, Dec 31 2023

%e Triangle starts:

%e [1] 1

%e [2] 1, 5

%e [3] 1, 7, 18

%e [4] 1, 9, 31, 56

%e [5] 1, 11, 48, 111, 160

%e [6] 1, 13, 69, 198, 351, 432

%e [7] 1, 15, 94, 325, 699, 1023, 1120

%e [8] 1, 17, 123, 500, 1280, 2223, 2815, 2816

%e [9] 1, 19, 156, 731, 2186, 4458, 6562, 7423, 6912

%p T := (n, k) -> binomial(2*n-1-k,k-1)*hypergeom([2,2,1-k], [1,1-2*k+2*n], -1):

%p seq(seq(simplify(T(n, k)), k=1..n), n=1..10);

%t T[n_, k_] := Sum[Binomial[2*n-k, 2*n-2*k+1+j]*Binomial[j+2, 2],{j, 0, 2*n-k}]; Flatten[Table[T[n, k], {n, 1, 10}, {k, 1, n}]] (* _Detlef Meya_, Dec 31 2023 *)

%o (PARI) T(n, k) = {sum(j=0, 2*n-k, binomial(2*n-k, 2*n - 2*k + 1 + j) * binomial(j+2, 2))} \\ _Andrew Howroyd_, Dec 31 2023

%o (Python)

%o from functools import cache

%o @cache

%o def T(n, k):

%o if k < 1 or n < 1: return 0

%o if k == 1: return 1

%o if k == n: return n * (n + 3) * 2**(n - 3)

%o return T(n-1, k) + 2*T(n-1, k-1) - T(n-2, k-2)

%o for n in range(1, 10): print([T(n, k) for k in range(1, n+1)])

%o # after _Detlef Meya_, _Peter Luschny_, Jan 01 2024

%Y Row sums with shifted indices in A318947.

%Y T(n, n) = A001793(n).

%K nonn,tabl

%O 1,3

%A _Peter Luschny_, Oct 28 2018