login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.
39

%I #13 Nov 02 2023 07:54:50

%S 1,0,1,1,0,1,0,2,0,1,3,0,3,0,1,0,6,0,4,0,1,10,0,10,0,5,0,1,0,20,0,15,

%T 0,6,0,1,35,0,35,0,21,0,7,0,1,0,70,0,56,0,28,0,8,0,1,126,0,126,0,84,0,

%U 36,0,9,0,1,0,252,0,210,0,120,0,45,0,10,0,1

%N Triangle read by rows where T(n,k) is the number of integer compositions of n with alternating sum k = 0..n. Part of the full triangle A097805.

%C A composition of n is a finite sequence of positive integers summing to n.

%C The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.

%e Triangle begins:

%e 1

%e 0 1

%e 1 0 1

%e 0 2 0 1

%e 3 0 3 0 1

%e 0 6 0 4 0 1

%e 10 0 10 0 5 0 1

%e 0 20 0 15 0 6 0 1

%e 35 0 35 0 21 0 7 0 1

%e 0 70 0 56 0 28 0 8 0 1

%e 126 0 126 0 84 0 36 0 9 0 1

%e 0 252 0 210 0 120 0 45 0 10 0 1

%e 462 0 462 0 330 0 165 0 55 0 11 0 1

%e 0 924 0 792 0 495 0 220 0 66 0 12 0 1

%e For example, row n = 5 counts the following compositions:

%e . (32) . (41) . (5)

%e (122) (113)

%e (221) (212)

%e (1121) (311)

%e (2111)

%e (11111)

%t Prepend[Table[If[EvenQ[nn],Prepend[#,0],#]&[Riffle[Table[Binomial[nn,k],{k,Floor[nn/2],nn}],0]],{nn,0,10}],{1}]

%Y The full triangle counting compositions by alternating sum is A097805.

%Y The version for partitions is A103919, full triangle A344651.

%Y This is the right-half of even-indexed rows of A260492.

%Y The triangle without top row and left column is A108044.

%Y Ranking and counting compositions:

%Y - product = sum: A335404, counted by A335405.

%Y - sum = twice alternating sum: A348614, counted by A262977.

%Y - length = alternating sum: A357184, counted by A357182.

%Y - length = absolute value of alternating sum: A357185, counted by A357183.

%Y A003242 counts anti-run compositions, ranked by A333489.

%Y A011782 counts compositions.

%Y A025047 counts alternating compositions, ranked by A345167.

%Y A032020 counts strict compositions, ranked by A233564.

%Y A124754 gives alternating sums of standard compositions.

%Y A238279 counts compositions by sum and number of maximal runs.

%Y Cf. A000120, A051159, A070939, A114220, A114901, A242882, A262046.

%K nonn,easy,tabl

%O 0,8

%A _Gus Wiseman_, Sep 30 2022