login
A291904
Triangle read by rows: T(n,k) = T(n-k,k-1) + T(n-k,k+1) with T(0,0) = 1 for 0 <= k <= A003056(n).
5
1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 2, 1, 0, 0, 2, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 3, 2, 0, 0, 3, 2, 1, 1, 1, 0, 2, 3, 2, 1, 0, 0, 3, 4, 3, 1, 0, 0, 4, 4, 3, 2, 1, 0, 4, 6, 4, 2, 0, 0, 6, 7
OFFSET
0,38
COMMENTS
T(n,k) is the number of integer compositions of n with first part 1, last part k, and all adjacent differences in {-1,1}. - John Tyler Rascoe, Aug 14 2023
LINKS
FORMULA
From John Tyler Rascoe, Aug 14 2023: (Start)
This triangle is T_1(n,k) of the general triangle T_m(n,k) for compositions of this kind with first part m.
T_m(n,k) for 0 < m, 0 <= n, and 0 <= k <= A003056(n+A000217(m-1)).
T_m(0,0) = T_m(m,m) = 1.
T_m(n,k) = T_m(n-k,k-1) + T_m(n-k,k+1) for m < n and 0 < k <= A003056(n+A000217(m-1)).
T_m(n,k) = 0 for 0 < n < m or n < k.
T_m(n,0) = 0 for 0 < n. (End)
EXAMPLE
First few rows are:
1;
0, 1;
0, 0;
0, 0, 1;
0, 1, 0;
0, 0, 0;
0, 0, 1, 1;
0, 1, 0, 0;
0, 0, 1, 0;
0, 1, 1, 1;
0, 1, 0, 0, 1;
0, 0, 2, 1, 0;
0, 2, 1, 1, 0.
MATHEMATICA
T[0, 0] = 1; T[_, 0] = 0; T[n_?Positive, k_] /; 0 < k <= Floor[(Sqrt[8n+1] - 1)/2] := T[n, k] = T[n-k, k-1] + T[n-k, k+1]; T[_, _] = 0;
Table[T[n, k], {n, 0, 20}, {k, 0, Floor[(Sqrt[8n+1] - 1)/2]}] // Flatten (* Jean-François Alcover, May 29 2019 *)
CROSSREFS
Row sums give A291905.
Columns 0-1 give A000007, A227310 (for n>0).
Sequence in context: A347031 A125676 A291955 * A249808 A258453 A025874
KEYWORD
nonn,tabf
AUTHOR
Seiichi Manyama, Sep 05 2017
STATUS
approved