[go: up one dir, main page]

login
A318301
Triangle T(n, k) read by rows: T(0, 0) = 1 and T(n, k) = Sum_{i=0..k-1} T(n, i) + Sum_{i=k..n-1} T(n-1, i).
0
1, 1, 1, 2, 3, 5, 10, 18, 33, 61, 122, 234, 450, 867, 1673, 3346, 6570, 12906, 25362, 49857, 98041, 196082, 388818, 771066, 1529226, 3033090, 6016323, 11934605, 23869210, 47542338, 94695858, 188620650, 275712074, 748391058, 1490765793, 2969596981, 5939193962, 11854518714
OFFSET
0,4
COMMENTS
The left edge of the triangle appears to be A005321.
FORMULA
An equivalent recursion: T(0, 0) = T(1, 0) = 1, T(n, 0) = 2*T(n-1, n-1) if n>=2, T(n, k) = 2*T(n, k-1) - T(n-1, k-1) if n>=k>=1.
EXAMPLE
Triangle begins:
1
1 1
2 3 5
10 18 33 61
122 234 450 867 1673
3346 6570 12906 25362 49857 98041
...
T(5, 2) = (3346 + 6570) + (450 + 867 + 1673) = 12906;
T(5, 2) = 2 * 6570 - 234 = 12906.
PROG
(Python)
def T(n, k):
if k == 0:
if n == 0 or n == 1:
return 1
return 2 * T(n-1, n-1)
return 2 * T(n, k-1) - T(n-1, k-1)
(PARI) T(n, k) = if (k == 0, if (n <= 1, 1, 2 * T(n-1, n-1)), 2 * T(n, k-1) - T(n-1, k-1));
tabl(nn) = for (n=0, nn, for (k=0, n, print1(T(n, k), ", ")); print); \\ Michel Marcus, Aug 25 2018
CROSSREFS
Cf. A005321.
Sequence in context: A117222 A199594 A081172 * A030032 A002661 A216959
KEYWORD
nonn,tabl
AUTHOR
Nicolas Nagel, Aug 24 2018
STATUS
approved