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 such that there is more than one integer b such that the b-based partial alternating sums of c are all positive. Here, the b-based partial alternating sums of a finite sequence q are given by pas(q,b)_j = (-1)^j * b + 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.
Are all these compositions free of 2?
From Christian Sievers, Jan 09 2026: (Start)
The terms in these compositions are all at least 3: for a different composition to have the same first sums as (a, b, c, d, e, ...) has, it has to be of the form (a+k, b-k, c+k, d-k, e+k, ...) for some nonzero integer k. For a first sum to be 2, it has to come from two adjacent 1 terms. But then the second composition giving the same first sums would have a term 1-|k| < 1, which is not allowed.
Equivalently, number of compositions of n that are the first sums of a composition with terms that are at least 2 at every other position. (End)
LINKS
Christian Sievers, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,1,0,-1,-1,-1).
FORMULA
G.f.: (x^3+x^4-x^5-x^6)/(1-2*x^2-x^3+x^5+x^6+x^7). - Christian Sievers, Jan 11 2026
EXAMPLE
The composition (2,4,3) is not the first sums of any composition, so (2,4,3) is not counted under a(9).
The composition (3,4,3) is the first sums of (1,2,2,1) only, so (3,4,3) is not counted under a(10).
The composition (3,3,5) is the first sums of (1,2,1,4) and (2,1,2,3), so (3,3,5) is counted under a(11).
The a(3) = 1 through a(11) = 12 compositions are:
(3) (4) (5) (6) (7) (8) (9) (10) (11)
(3,3) (3,4) (3,5) (3,6) (3,7) (3,8)
(4,3) (4,4) (4,5) (4,6) (4,7)
(5,3) (5,4) (5,5) (5,6)
(6,3) (6,4) (6,5)
(3,3,3) (7,3) (7,4)
(3,3,4) (8,3)
(4,3,3) (3,3,5)
(3,4,4)
(4,3,4)
(4,4,3)
(5,3,3)
MATHEMATICA
pas[y_, k_]:=Table[(-1)^j*k+Sum[(-1)^(i+j)*y[[i]], {i, j}], {j, 0, Length[y]}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], Length[Select[Table[pas[#, b], {b, 0, Max[#]}], Min@@#>=1&]]>1&]], {n, 1, 10}]
PROG
(PARI) a(n)=polcoef((x^3+x^4-x^5-x^6)/(1-2*x^2-x^3+x^5+x^6+x^7)+O(x*x^n), n) \\ Christian Sievers, Jan 11 2026
CROSSREFS
The compositions are ranked by A391627.
A011782 counts compositions.
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.
A391621 counts nonnegative sequences with standard first sums.
A391642 counts compositions with standard first sums.
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Jan 07 2026
EXTENSIONS
a(21) onward from Christian Sievers, Jan 11 2026
STATUS
approved
