login
A392369
Sum of odd-indexed parts of the reversed n-th composition in standard order.
9
0, 1, 2, 1, 3, 1, 2, 2, 4, 1, 2, 3, 3, 2, 3, 2, 5, 1, 2, 4, 3, 3, 4, 2, 4, 2, 3, 3, 4, 2, 3, 3, 6, 1, 2, 5, 3, 4, 5, 2, 4, 3, 4, 3, 5, 2, 3, 4, 5, 2, 3, 4, 4, 3, 4, 3, 5, 2, 3, 4, 4, 3, 4, 3, 7, 1, 2, 6, 3, 5, 6, 2, 4, 4, 5, 3, 6, 2, 3, 5, 5, 3, 4, 4, 5, 3, 4
OFFSET
0,3
COMMENTS
The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
Also the sum of 0-based partial alternating sums of the reversed n-th composition in standard order. 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 0-based partial alternating sums of q = (a,b,c,d,e) are:
pas(q,0)_1 = a
pas(q,0)_2 = -a + b
pas(q,0)_3 = a - b + c
pas(q,0)_4 = -a + b - c + d
pas(q,0)_5 = a - b + c - d + e
FORMULA
a(n) + A392370(n) = A029837(n+1).
EXAMPLE
The 300th composition in standard order is (3,2,1,3), reversed (3,1,2,3), with odd-indexed parts (3,2), so a(300) = 5.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
go[c_]:=Sum[If[OddQ[i], c[[i]], 0], {i, Length[c]}];
Table[go[Reverse[stc[n]]], {n, 0, 100}]
CROSSREFS
The un-reversed version is A209281, even A346633.
For prime indices we have A346697, row sums of A346703.
For reversed prime indices we have A346699, row sums of A391981.
These are row sums of A391983, reverse A391984.
The even-indexed version is A392370.
A011782 counts compositions.
A066099 lists standard compositions, sums A070939, first sums A390432.
A116406 counts compositions with alternating sum >= 0.
A344618 gives reverse-alternating sums of standard compositions, see also A124754.
A357213 counts compositions by sum of first sums.
A390673 ranks compositions with distinct first sums, count A390567.
A390676 ranks compositions that are first sums, union of A390568.
A390745 ranks compositions that are uniquely first sums, count A391644.
Sequence in context: A360330 A035197 A227872 * A323165 A091948 A339443
KEYWORD
nonn
AUTHOR
Gus Wiseman, Jan 14 2026
STATUS
approved