OFFSET

0,4

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. See also A000120, A059893, A070939, A114994, A225620.

LINKS

EXAMPLE

The 89th composition in standard order is (2,1,3,1), with weak nonexcedances {2,3,4}, so a(89) = 3.

MATHEMATICA

stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n, 2]], 1], 0]]//Reverse;

paw[y_]:=Length[Select[Range[Length[y]], #>=y[[#]]&]];

Table[paw[stc[n]], {n, 0, 30}]

CROSSREFS

KEYWORD

nonn

AUTHOR

Gus Wiseman, Mar 23 2022

STATUS

approved