OFFSET
1,3
COMMENTS
Also the T(n,k) is the number of integer partitions (of any positive integer) with length k such that the maximum of the length and the largest part is n.
When k < n, then the last number is n.
FORMULA
T(n,n) = binomial(2*n-1,n).
T(n,k) = binomial(k+n-2, n-1) for k < n.
EXAMPLE
Triangle begins:
1
1 3
1 3 10
1 4 10 35
1 5 15 35 126
1 6 21 56 126 462
1 7 28 84 210 462 1716
...
For T(3,1) solution is |{(3)}| = 1.
For T(3,2) solution is |{(1,3), (2,3), (3,3)}| = 3.
For T(3,3) solution is |{(1,1,1), (1,1,2), (1,1,3), (1,2,2), (1,2,3), (1,3,3), (2,2,2), (2,2,3), (2,3,3), (3,3,3)}| = 10.
MATHEMATICA
T[n_, k_] := Which[
k == 1, 1,
k == n, Binomial[2n-1, n],
k == n-1, T[n-1, n-1],
1 < k < n-1, T[n-1, k] + T[n, k-1]
];
Table[T[n, k], {n, 1, 10}, {k, 1, n}] // Flatten
PROG
(PARI) T(n, k)={if(k<n, binomial(k+n-2, n-1), binomial(2*n-1, n))} \\ Andrew Howroyd, Nov 24 2024
CROSSREFS
KEYWORD
AUTHOR
Zlatko Damijanic, Nov 24 2024
STATUS
approved