login
A390568
The number k such that the k-th composition in standard order is the first sums of the n-th composition in standard order.
48
0, 0, 0, 2, 0, 4, 4, 10, 0, 8, 8, 18, 8, 36, 20, 42, 0, 16, 16, 34, 16, 68, 36, 74, 16, 136, 72, 146, 40, 164, 84, 170, 0, 32, 32, 66, 32, 132, 68, 138, 32, 264, 136, 274, 72, 292, 148, 298, 32, 528, 272, 546, 144, 580, 292, 586, 80, 648, 328, 658, 168, 676, 340
OFFSET
0,4
COMMENTS
Represents the "first sums" transformation on integer compositions.
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.
The first sums of a nonempty sequence (a, b, c, d, ...) are (a+b, b+c, c+d, ...).
Since A390432 contains no ones, all terms are even.
EXAMPLE
The 13-th composition in standard order is (1,2,1), with first sums (3,3), which is the 36-th composition in standard order, so a(13) = 36.
MATHEMATICA
stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;
firsums[c_]:=Table[c[[i]]+c[[i+1]], {i, Length[c]-1}];
stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
Table[stcinv[firsums[stc[n]]], {n, 0, 100}]
PROG
(Python) # see links
CROSSREFS
Positions of powers of 2 are A018900.
For first differences instead of first sums see A358133.
This is the standard composition number of the n-th row of A390432.
For Heinz numbers of partitions we have A390449, counted by A390307 or A390362.
The union is A390676, complement A390677 (no 1 A390678), for partitions A390448.
The terms appearing only once are listed by A390745.
A011782 counts compositions.
A066099 lists all compositions in standard order.
A351014 counts distinct runs in standard compositions.
A390673 ranks compositions with distinct first sums, counted by A390567.
A390674 ranks compositions with equal first sums, counted by A342527.
A390675 counts compositions whose first sums are standard compositions.
Sequence in context: A147980 A021493 A195395 * A296805 A336974 A084247
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Nov 17 2025
STATUS
approved