login
A368579
Triangle read by rows. T(n, k) is the number of compositions of n where the first part k is the largest part and the last part is not 1.
2
1, -1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 2, 2, 1, 0, 1, 0, 0, 3, 3, 2, 1, 0, 1, 0, 0, 5, 6, 4, 2, 1, 0, 1, 0, 0, 8, 11, 7, 4, 2, 1, 0, 1, 0, 0, 13, 20, 14, 8, 4, 2, 1, 0, 1, 0, 0, 21, 37, 27, 15, 8, 4, 2, 1, 0, 1
OFFSET
0,24
FORMULA
T(n, k) = F(k+1, n+1-k) - F(k+1, n-k) where F(k, n) = Sum_{j=1..min(n, k)} F(k, n-j) if n > 1 and otherwise n. F(n, k) refers to the generalized Fibonacci numbers A092921.
EXAMPLE
Triangle T(n, k) starts:
[0] [ 1]
[1] [-1, 1]
[2] [ 0, 0, 1]
[3] [ 0, 0, 0, 1]
[4] [ 0, 0, 1, 0, 1]
[5] [ 0, 0, 1, 1, 0, 1]
[6] [ 0, 0, 2, 2, 1, 0, 1]
[7] [ 0, 0, 3, 3, 2, 1, 0, 1]
[8] [ 0, 0, 5, 6, 4, 2, 1, 0, 1]
[9] [ 0, 0, 8, 11, 7, 4, 2, 1, 0, 1]
For instance, row 6 lists the compositions below:
0 .
1 .
2 [2, 2, 2], [2, 1, 1, 2];
3 [3, 3], [3, 1, 2];
4 [4, 2];
5 .
6 [6].
PROG
(Python)
from functools import cache
@cache
def F(k, n):
return sum(F(k, n-j) for j in range(1, min(k, n))) if n > 1 else n
def Trow(n):
return list(F(k+1, n+1-k) - F(k+1, n-k) for k in range(n+1))
print(flatten([Trow(n) for n in range(12)]))
CROSSREFS
Cf. A368279 (row sums), A092921 (generalized Fibonacci), A000045 (Fibonacci column k=2), A034008 (T(2n, n)).
Sequence in context: A377942 A347687 A368948 * A287331 A179769 A340594
KEYWORD
sign,tabl
AUTHOR
Peter Luschny, Jan 05 2024
STATUS
approved