OFFSET
1,5
COMMENTS
The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).
Also the number of integer compositions c of n with a unique integer k such that the k-based partial alternating sums of c are all positive. 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. This is a signed version of the partial sums transformation, inverse to the "first sums" transformation.
Compositions whose first sums are not achieved by any other composition are those that have at least one 1 at both the odd and the even positions. - Christian Sievers, Jan 09 2026
LINKS
Christian Sievers, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,4,1,-4,-3,-1,1,2,2).
FORMULA
G.f.: (x^2-3*x^4+x^5+3*x^6-2*x^7-x^8+x^9)/(1-4*x^2-x^3+4*x^4+3*x^5+x^6-x^7-2*x^8-2*x^9). - Christian Sievers, Jan 11 2026
EXAMPLE
The composition (3,2,4) is the first sums of (2,1,1,3) and no other composition, so (3,2,4) is counted under a(9).
The a(2) = 1 through a(9) = 10 compositions:
(2) . (2,2) (2,3) (2,4) (2,5) (2,6) (2,7)
(3,2) (4,2) (5,2) (6,2) (7,2)
(2,2,2) (2,2,3) (2,2,4) (2,2,5)
(3,2,2) (2,3,3) (2,3,4)
(3,2,3) (3,2,4)
(3,3,2) (4,2,3)
(4,2,2) (4,3,2)
(2,2,2,2) (5,2,2)
(2,2,2,3)
(3,2,2,2)
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, k], {k, 0, Max[m]}], Min@@#>0&];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Length[cga[#]]==1&]], {n, 15}]
PROG
(PARI) a(n)=polcoef((x^2-3*x^4+x^5+3*x^6-2*x^7-x^8+x^9)/(1-4*x^2-x^3+4*x^4+3*x^5+x^6-x^7-2*x^8-2*x^9)+O(x*x^n), n) \\ Christian Sievers, Jan 11 2026
CROSSREFS
The compositions are ranked by A390745.
A011782 counts compositions.
A066099 lists all compositions in standard order.
A357213 counts compositions by sum of first sums.
A390432 lists first sums of standard compositions.
A390678 ranks compositions with no 1's that are not first sums.
A391642 counts compositions with standard first sums.
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Jan 06 2026
EXTENSIONS
a(21) onward from Christian Sievers, Jan 11 2026
STATUS
approved
