login
Number of integer compositions of n that are the 0-prepended first sums of some finite sequence of distinct integers.
9

%I #13 Feb 28 2026 17:58:58

%S 1,1,2,2,5,10,14,22,41,69,121,195,320,533,894,1485,2485,4052,6760,

%T 11079,18342,29988,49530,81291,133889,219047,360407,587482,965947,

%U 1576544,2586545,4220057,6912596,11267114,18441879,30051404,49142538,80048584,130796055

%N Number of integer compositions of n that are the 0-prepended first sums of some finite sequence of distinct integers.

%C The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).

%C 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.

%C For example, the k-based partial alternating sums of q = (a,b,c,d,e) are:

%C pas(q,k)_0 = k

%C pas(q,k)_1 = -k + a

%C pas(q,k)_2 = k - a + b

%C pas(q,k)_3 = -k + a - b + c

%C pas(q,k)_4 = k - a + b - c + d

%C pas(q,k)_5 = -k + a - b + c - d + e

%C These are trimmed by removing the zeroth line (which is always k).

%e The composition (2,1,2,1) is the first sums of (0,2,-1,3,-2) so is counted under a(6).

%e 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).

%e The a(1) = 1 through a(6) = 14 compositions:

%e (1) (2) (3) (4) (5) (6)

%e (1,1) (2,1) (1,3) (1,4) (1,5)

%e (2,2) (2,3) (3,3)

%e (3,1) (3,2) (4,2)

%e (1,1,2) (4,1) (5,1)

%e (1,1,3) (1,1,4)

%e (1,3,1) (1,3,2)

%e (2,1,2) (1,4,1)

%e (2,2,1) (2,1,3)

%e (1,1,2,1) (2,3,1)

%e (3,1,2)

%e (3,2,1)

%e (1,1,3,1)

%e (2,1,2,1)

%t pas[y_,k_]:=Table[(-1)^j*k+Sum[(-1)^(i+j)*y[[i]],{i,j}],{j,0,Length[y]}];

%t Table[Length[Select[Join @@ Permutations/@IntegerPartitions[n], UnsameQ@@Rest[pas[#,0]]&]],{n,0,15}]

%Y For partitions instead of compositions we have A000009, ranks A392697.

%Y For reversed partitions the non-trimmed version is A392701, ranks A392695.

%Y The non-trimmed version is A392703, ranks A392708.

%Y For reversed partitions we have A392704, ranks A392698.

%Y These compositions are ranked by A392709.

%Y A000041 counts integer partitions, strict A000009.

%Y A103919 counts partitions by sum and alternating sum (reverse A344612).

%Y A344610 counts partitions by sum and positive reverse-alternating sum.

%Y A390567 counts compositions with distinct first sums, ranks A390673.

%Y Cf. A000070, A000097, A053251, A325325, A390429, A390446, A390989, A391620, A391629.

%K nonn

%O 0,3

%A _Gus Wiseman_, Jan 31 2026

%E a(23)-a(38) from _Christian Sievers_, Feb 08 2026