A097805 Number of compositions of n with k parts, T(n, k) = binomial(n-1, k-1) for n, k >= 1 and T(n, 0) = 0^n, triangle read by rows for n >= 0 and 0 <= k <= n.
1, 0, 1, 0, 1, 1, 0, 1, 2, 1, 0, 1, 3, 3, 1, 0, 1, 4, 6, 4, 1, 0, 1, 5, 10, 10, 5, 1, 0, 1, 6, 15, 20, 15, 6, 1, 0, 1, 7, 21, 35, 35, 21, 7, 1, 0, 1, 8, 28, 56, 70, 56, 28, 8, 1, 0, 1, 9, 36, 84, 126, 126, 84, 36, 9, 1, 0, 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, 0, 1, 11, 55, 165, 330, 462, 462, 330, 165, 55, 11, 1
Offset: 0
A345908 Traces of the matrices (A345197) counting integer compositions by length and alternating sum.
1, 1, 0, 1, 3, 3, 6, 15, 24, 43, 92, 171, 315, 629, 1218, 2313, 4523, 8835, 17076, 33299, 65169
Offset: 0
Comments
The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i. So a(n) is the number of compositions of n of length (n + s)/2, where s is the alternating sum of the composition.
Examples
The a(0) = 1 through a(7) = 15 compositions of n = 0..7 of length (n + s)/2 where s = alternating sum (empty column indicated by dot): () (1) . (2,1) (2,2) (2,3) (2,4) (2,5) (1,1,2) (1,2,2) (1,3,2) (1,4,2) (2,1,1) (2,2,1) (2,3,1) (2,4,1) (1,1,3,1) (1,1,3,2) (2,1,2,1) (1,2,3,1) (3,1,1,1) (2,1,2,2) (2,2,2,1) (3,1,1,2) (3,2,1,1) (1,1,1,1,3) (1,1,2,1,2) (1,1,3,1,1) (2,1,1,1,2) (2,1,2,1,1) (3,1,1,1,1)
Crossrefs
Programs
-
Mathematica
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}]; Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[#]==(n+ats[#])/2&]],{n,0,15}]
A345907 Triangle giving the main antidiagonals of the matrices counting integer compositions by length and alternating sum (A345197).
1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 2, 2, 1, 1, 0, 0, 4, 3, 1, 1, 0, 0, 3, 6, 4, 1, 1, 0, 0, 6, 9, 8, 5, 1, 1, 0, 0, 0, 18, 18, 10, 6, 1, 1, 0, 0, 0, 10, 36, 30, 12, 7, 1, 1, 0, 0, 0, 20, 40, 60, 45, 14, 8, 1, 1, 0, 0, 0, 0, 80, 100, 90, 63, 16, 9, 1, 1
Offset: 0
Comments
The matrices (A345197) count the integer compositions of n of length k with alternating sum i, where 1 <= k <= n, and i ranges from -n + 2 to n in steps of 2. Here, the alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
Problem: What are the column sums? They appear to match A239201, but it is not clear why.
Examples
Triangle begins: 1 1 1 0 1 1 0 1 1 1 0 2 2 1 1 0 0 4 3 1 1 0 0 3 6 4 1 1 0 0 6 9 8 5 1 1 0 0 0 18 18 10 6 1 1 0 0 0 10 36 30 12 7 1 1 0 0 0 20 40 60 45 14 8 1 1 0 0 0 0 80 100 90 63 16 9 1 1 0 0 0 0 35 200 200 126 84 18 10 1 1 0 0 0 0 70 175 400 350 168 108 20 11 1 1 0 0 0 0 0 350 525 700 560 216 135 22 12 1 1
Crossrefs
Programs
-
Mathematica
ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}]; Table[Table[Length[Select[Join@@Permutations/@IntegerPartitions[n,{n-k}],k==(n+ats[#])/2-1&]],{k,0,n-1}],{n,0,15}]
Comments
Examples
References
Links
Crossrefs
Programs
Maple
Mathematica
PARI
PARI
PARI
Python
Sage
Formula
Extensions