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”).

A357182
Number of integer compositions of n with the same length as their alternating sum.
26
1, 1, 0, 0, 1, 3, 1, 4, 6, 20, 13, 48, 50, 175, 141, 512, 481, 1719, 1491, 5400, 4929, 17776, 15840, 57420, 52079, 188656, 169989, 617176, 559834, 2033175, 1842041, 6697744, 6085950, 22139780, 20123989, 73262232, 66697354, 242931321, 221314299, 806516560
OFFSET
0,6
COMMENTS
A composition of n is a finite sequence of positive integers summing to n.
The alternating sum of a sequence (y_1,...,y_k) is Sum_i (-1)^(i-1) y_i.
EXAMPLE
The a(1) = 1 through a(8) = 6 compositions:
(1) (31) (113) (42) (124) (53)
(212) (223) (1151)
(311) (322) (2141)
(421) (3131)
(4121)
(5111)
MATHEMATICA
ats[y_]:=Sum[(-1)^(i-1)*y[[i]], {i, Length[y]}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Length[#]==ats[#]&]], {n, 0, 15}]
CROSSREFS
For product instead of length we have A114220.
For sum equal to twice alternating sum we have A262977, ranked by A348614.
For product equal to sum we have A335405, ranked by A335404.
For absolute value we have A357183.
These compositions are ranked by A357184.
The case of partitions is A357189.
A003242 counts anti-run compositions, ranked by A333489.
A011782 counts compositions.
A025047 counts alternating compositions, ranked by A345167.
A124754 gives alternating sums of standard compositions.
A238279 counts compositions by sum and number of maximal runs.
A261983 counts non-anti-run compositions.
A357136 counts compositions by alternating sum.
Sequence in context: A186358 A170839 A049918 * A028861 A081521 A213224
KEYWORD
nonn
AUTHOR
Gus Wiseman, Sep 28 2022
EXTENSIONS
a(21)-a(39) from Alois P. Heinz, Sep 29 2022
STATUS
approved