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
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}]
Comments