login
Number of distinct runs in the n-th composition in standard order.
52

%I #14 Feb 10 2022 20:19:16

%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,3,2,3,2,1,1,2,

%T 2,2,1,3,3,2,2,3,1,2,3,2,2,2,2,2,3,3,3,2,2,3,2,3,2,2,2,3,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,3

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

%C The n-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 n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

%H Mathematics Stack Exchange, <a href="https://math.stackexchange.com/q/87559">What is a sequence run? (answered 2011-12-01)</a>

%e The number 3310 has binary expansion 110011101110 and standard composition (1,3,1,1,2,1,1,2), with runs (1), (3), (1,1), (2), (1,1), (2), of which 4 are distinct, so a(3310) = 4.

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

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

%Y Counting not necessarily distinct runs gives A124767.

%Y Using binary expansions instead of standard compositions gives A297770.

%Y Positions of first appearances are A351015.

%Y A005811 counts runs in binary expansion.

%Y A011782 counts integer compositions.

%Y A044813 lists numbers whose binary expansion has distinct run-lengths.

%Y A085207 represents concatenation of standard compositions, reverse A085208.

%Y A333489 ranks anti-runs, complement A348612.

%Y A345167 ranks alternating compositions, counted by A025047.

%Y A351204 counts partitions where every permutation has all distinct runs.

%Y Counting words with all distinct runs:

%Y - A351013 = compositions, for run-lengths A329739, ranked by A351290.

%Y - A351016 = binary words, for run-lengths A351017.

%Y - A351018 = binary expansions, for run-lengths A032020, ranked by A175413.

%Y - A351200 = patterns, for run-lengths A351292.

%Y - A351202 = permutations of prime factors.

%Y Selected statistics of standard compositions:

%Y - Length is A000120.

%Y - Sum is A070939.

%Y - Heinz number is A333219.

%Y - Number of distinct parts is A334028.

%Y Selected classes of standard compositions:

%Y - Partitions are A114994, strict A333256.

%Y - Multisets are A225620, strict A333255.

%Y - Strict compositions are A233564.

%Y - Constant compositions are A272919.

%Y Cf. A098859, A106356, A116608, A238279, A242882, A318928, A325545, A328592, A329745, A350952, A351201.

%K nonn

%O 0,6

%A _Gus Wiseman_, Feb 07 2022