OFFSET
0,4
LINKS
G. C. Greubel, Rows n = 0..50 of the triangle, flattened
FORMULA
T(n,k) = Sum_{j=0..n-1-k} T(n,k+j+1)*T(k+j,k) for n > k+1 > 0, with T(n,n) = 1 and T(n, n-1) = 2*n-1 for k >= 0.
EXAMPLE
Illustrate the recurrence by:
T(n,k) = [T(n,k+1),T(n,k+2), ..,T(n,n)]*[T(k,k),T(k+1,k),..,T(n-1,k)]:
T(3,0) = [8,5,1]*[1,1,4]~ = 8*1 + 5*1 + 1*4 = 17;
T(4,1) = [12,7,1]*[1,3,8]~ = 12*1 + 7*3 + 1*8 = 41;
T(5,1) = [73,16,9,1]*[1,3,8,41]~ = 73*1 + 16*3 + 9*8 + 1*41 = 234;
T(6,2) = [113,20,11,1]*[1,5,12,73]~ = 113*1 + 20*5 + 11*12 + 1*73 = 418.
Triangle begins:
1;
1, 1;
4, 3, 1;
17, 8, 5, 1;
98, 41, 12, 7, 1;
622, 234, 73, 16, 9, 1;
4512, 1602, 418, 113, 20, 11, 1;
35373, 11976, 3110, 650, 161, 24, 13, 1;
300974, 98541, 23920, 5242, 930, 217, 28, 15, 1;
2722070, 866942, 207549, 41304, 8094, 1258, 281, 32, 17, 1;
26118056, 8139602, 1885166, 377757, 65088, 11762, 1634, 353, 36, 19, 1;
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==n, 1, If[k==n-1, 2*n-1, Sum[T[n, k+j+1] *T[k+j, k], {j, 0, n-k-1}]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Jun 25 2024 *)
PROG
(PARI)
{T(n, k)=if(n==k, 1, if(n==k+1, 2*n-1, sum(i=0, n-k-1, T(n, k+i+1)*T(k+i, k))))};
for(n=0, 12, for(k=0, n, print1(T(n, k), ", ")); print(""))
(Magma)
function T(n, k) // T = A128320
if k eq n then return 1;
elif k eq n-1 then return 2*n-1;
else return (&+[T(n, k+j+1)*T(k+j, k): j in [0..n-k-1]]);
end if;
end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 25 2024
(SageMath)
@CachedFunction
def T(n, k): # T = A128320
if k==n: return 1
elif k==n-1: return 2*n-1
else: return sum(T(n, k+j+1)*T(k+j, k) for j in range(n-k))
flatten([[T(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jun 25 2024
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Paul D. Hanna, Feb 25 2007
STATUS
approved