OFFSET
0,8
COMMENTS
FORMULA
T(n,k) = T(n-1,k-1) + T(n-2,k-1), T(0,0) = 1, T(1,0) = T(2,0) = -1, T(n,0) = 0 for n>2, T(n,k) = 0 if k>n.
EXAMPLE
Triangle T(n,k) begins:
1;
-1, 1;
-1, 0, 1;
0, -2, 1, 1;
0, -1, -2, 2, 1;
0, 0, -3, -1, 3, 1;
...
PROG
(Python)
from functools import cache
@cache
def T(n, k):
if k > n: return 0
if n == 0: return 1
if k == 0: return -1 if n == 1 or n == 2 else 0
return T(n-1, k-1) + T(n-2, k-1)
for n in range(9):
print([T(n, k) for k in range(n+1)]) # Peter Luschny, Feb 28 2024
CROSSREFS
KEYWORD
AUTHOR
Philippe Deléham, Feb 27 2024
STATUS
approved