login
Number of distinct parts in the n-th composition in standard order.
40

%I #5 Apr 18 2020 11:51:02

%S 0,1,1,1,1,2,2,1,1,2,1,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,2,

%T 2,2,1,3,3,2,2,3,1,2,3,2,2,2,2,2,3,2,3,2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,

%U 2,3,3,2,2,2,2,3,2,3,3,2,2,3,2,3,2,2,2

%N Number of distinct parts in the n-th composition in standard order.

%C A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of 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.

%e The 77th composition is (3,1,2,1), so a(77) = 3.

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

%t Table[Length[Union[stc[n]]],{n,0,100}]

%Y Number of distinct prime indices is A001221.

%Y Positions of first appearances (offset 1) are A246534.

%Y Positions of 1's are A272919.

%Y All of the following pertain to compositions in standard order (A066099):

%Y - Length is A000120.

%Y - Necklaces are A065609.

%Y - Sum is A070939.

%Y - Runs are counted by A124767.

%Y - Rotational symmetries are counted by A138904.

%Y - Strict compositions are A233564.

%Y - Constant compositions are A272919.

%Y - Aperiodic compositions are A328594.

%Y - Rotational period is A333632.

%Y - Dealings are A333939.

%Y Cf. A001037, A059966, A060223, A066099, A333765, A333940.

%K nonn

%O 0,6

%A _Gus Wiseman_, Apr 18 2020