login
A392702
Number of integer compositions of n that are the 0-prepended first sums of some finite sequence of distinct integers.
9
1, 1, 2, 2, 5, 10, 14, 22, 41, 69, 121, 195, 320, 533, 894, 1485, 2485, 4052, 6760, 11079, 18342, 29988, 49530, 81291, 133889, 219047, 360407, 587482, 965947, 1576544, 2586545, 4220057, 6912596, 11267114, 18441879, 30051404, 49142538, 80048584, 130796055
OFFSET
0,3
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 with all distinct trimmed 0-based partial alternating sums. Here, the k-based partial alternating sums of a finite 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.
For example, the k-based partial alternating sums of q = (a,b,c,d,e) are:
pas(q,k)_0 = k
pas(q,k)_1 = -k + a
pas(q,k)_2 = k - a + b
pas(q,k)_3 = -k + a - b + c
pas(q,k)_4 = k - a + b - c + d
pas(q,k)_5 = -k + a - b + c - d + e
These are trimmed by removing the zeroth line (which is always k).
EXAMPLE
The composition (2,1,2,1) is the first sums of (0,2,-1,3,-2) so is counted under a(6).
The composition (1,2,1,2) has 0-based partial alternating sums (0,1,1,0,2), trimmed (1,1,0,2), so is not counted under a(6).
The a(1) = 1 through a(6) = 14 compositions:
(1) (2) (3) (4) (5) (6)
(1,1) (2,1) (1,3) (1,4) (1,5)
(2,2) (2,3) (3,3)
(3,1) (3,2) (4,2)
(1,1,2) (4,1) (5,1)
(1,1,3) (1,1,4)
(1,3,1) (1,3,2)
(2,1,2) (1,4,1)
(2,2,1) (2,1,3)
(1,1,2,1) (2,3,1)
(3,1,2)
(3,2,1)
(1,1,3,1)
(2,1,2,1)
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], UnsameQ@@Rest[pas[#, 0]]&]], {n, 0, 15}]
CROSSREFS
For partitions instead of compositions we have A000009, ranks A392697.
For reversed partitions the non-trimmed version is A392701, ranks A392695.
The non-trimmed version is A392703, ranks A392708.
For reversed partitions we have A392704, ranks A392698.
These compositions are ranked by A392709.
A000041 counts integer partitions, strict A000009.
A103919 counts partitions by sum and alternating sum (reverse A344612).
A344610 counts partitions by sum and positive reverse-alternating sum.
A390567 counts compositions with distinct first sums, ranks A390673.
Sequence in context: A208788 A246864 A262924 * A389601 A331540 A329676
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 31 2026
EXTENSIONS
a(23)-a(38) from Christian Sievers, Feb 08 2026
STATUS
approved