OFFSET
1,6
COMMENTS
The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).
Also the number of compositions c of n with no integer k such that the k-based partial alternating sums of c are nonnegative. Here, the k-based partial alternating sums of a sequence q are given by pas(q,k)_j = (-1)^j * k + Sum_{i=1..j} (-1)^(i+j) * q_i.
LINKS
Christian Sievers, Table of n, a(n) for n = 1..1000
FORMULA
G.f.: x^5/(1-3*x-2*x^2+11*x^3-3*x^4-6*x^5). - Christian Sievers, Jan 14 2026
EXAMPLE
The composition (4,2,5,3) is the first sums of (4,0,2,3,0) so is not counted under a(14).
The k-based partial alternating sums of (2,5,2) are (k, 2-k, 3+k, -1-k), which is not nonnegative for any k, so (2,5,2) is counted under a(9).
The a(1) = 0 through a(7) = 11 compositions:
. . . . (131) (141) (142)
(1131) (151)
(1311) (241)
(1141)
(1312)
(1411)
(2131)
(11131)
(11311)
(12121)
(13111)
MATHEMATICA
pas[y_, k_]:=Table[(-1)^j*k+Sum[(-1)^(i+j)*y[[i]], {i, j}], {j, 0, Length[y]}];
cga[m_]:=Select[Table[pas[m, b], {b, 0, Max[m]}], Min@@#>=0&];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Length[cga[#]]==0&]], {n, 1, 10}]
PROG
(PARI) a(n)=polcoef(x^5/(1-3*x-2*x^2+11*x^3-3*x^4-6*x^5)+O(x*x^n), n) \\ Christian Sievers, Jan 14 2026
CROSSREFS
These compositions are ranked by A390747.
The case of all parts > 1 is A391679.
For compositions instead of nonnegative sequences we have:
A011782 counts compositions.
A357213 counts compositions by sum of first sums.
A390678 ranks compositions with no 1's that are not first sums.
A391621 counts nonnegative sequences with standard first sums.
A391642 counts compositions with standard first sums.
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Jan 05 2026
EXTENSIONS
a(21) onward from Christian Sievers, Jan 14 2026
STATUS
approved
