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.
LINKS
John Tyler Rascoe, Table of n, a(n) for n = 0..8192
John Tyler Rascoe, Python code.
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.
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.
A390675 counts compositions whose first sums are standard compositions.
KEYWORD
nonn,easy
AUTHOR
Gus Wiseman, Nov 17 2025
STATUS
approved
