OFFSET
1,2
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 of n whose k-based partial alternating sums are not all > 1 for any integer k. 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
Index entries for linear recurrences with constant coefficients, signature (2,2,-4,0,1,-3,1,2,-1,2).
FORMULA
From Christian Sievers, Jan 15 2026: (Start)
G.f.: x*(1 - 2*x^2 - x^3 + x^4 + 2*x^5 - x^7 + x^9)/((1 - 2*x)*(1 - x^2 - x^4)*(1 - x^2 - x^5)). (End)
EXAMPLE
The composition (5,4) is the first sums of (3,2,2) so is not counted under a(9).
The a(1) = 1 through a(5) = 15 compositions:
(1) (2) (3) (1,3) (1,4)
(1,1) (1,2) (2,2) (2,3)
(2,1) (3,1) (3,2)
(1,1,1) (1,1,2) (4,1)
(1,2,1) (1,1,3)
(2,1,1) (1,2,2)
(1,1,1,1) (1,3,1)
(2,1,2)
(2,2,1)
(3,1,1)
(1,1,1,2)
(1,1,2,1)
(1,2,1,1)
(2,1,1,1)
(1,1,1,1,1)
MATHEMATICA
pas[y_, k_]:=Table[(-1)^j*k+Sum[(-1)^(i+j)*y[[i]], {i, j}], {j, 0, Length[y]}];
agc[m_]:=Select[Table[pas[m, b], {b, 1, Max[m]}], Min@@#>1&];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[n], agc[#]=={}&]], {n, 15}]
PROG
(PARI) a(n)=polcoef((x-2*x^3-x^4+x^5+2*x^6-x^8+x^10)/(1-2*x-2*x^2+4*x^3-x^5+3*x^6-x^7-2*x^8+x^9-2*x^10)+O(x*x^n), n) \\ Christian Sievers, Jan 15 2026
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Jan 01 2026
EXTENSIONS
a(21) onward from Christian Sievers, Jan 15 2026
STATUS
approved
