%I #6 Aug 02 2024 09:00:01
%S 0,1,2,2,3,2,1,3,4,3,4,3,1,1,2,4,5,4,3,4,2,4,2,4,1,1,3,2,2,2,3,5,6,5,
%T 4,5,6,3,3,5,2,2,6,5,2,2,3,5,1,1,1,2,1,3,1,3,2,2,4,3,3,3,4,6,7,6,5,6,
%U 4,4,4,6,3,6,5,4,3,3,4,6,2,2,2,3,4,6,4
%N Sum of leaders of maximal anti-runs in the n-th composition in standard order.
%C The leaders of anti-runs in a sequence are obtained by splitting it into maximal consecutive anti-runs (sequences with no adjacent equal terms) and taking the first term of each.
%C 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.
%H Gus Wiseman, <a href="/A374629/a374629.txt">Sequences counting and ranking compositions by their leaders (for six types of runs)</a>.
%e The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1), with maximal anti-runs ((3,2,1,2),(2,1,2,5,1),(1),(1)), so a(1234567) is 3 + 2 + 1 + 1 = 7.
%t stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
%t Table[Total[First/@Split[stc[n],UnsameQ]],{n,0,100}]
%Y For length instead of sum we have A333381.
%Y Row-sums of A374515.
%Y Other types of runs (instead of anti-):
%Y - For identical runs we have A373953, row-sums of A374251.
%Y - For weakly increasing runs we have A374630, row-sums of A374629.
%Y - For strictly increasing runs we have A374684, row-sums of A374683.
%Y - For weakly decreasing runs we have A374741, row-sums of A374740.
%Y - For strictly decreasing runs we have A374758, row-sums of A374757.
%Y A065120 gives leaders of standard compositions.
%Y A106356 counts compositions by number of maximal anti-runs.
%Y A238279 counts compositions by number of maximal runs
%Y A238424 counts partitions whose first differences are an anti-run.
%Y All of the following pertain to compositions in standard order:
%Y - Length is A000120.
%Y - Sum is A029837(n+1).
%Y - Parts are listed by A066099.
%Y - Number of adjacent equal pairs is A124762, unequal A333382.
%Y - Anti-runs are ranked by A333489, counted by A003242.
%Y - Run-length transform is A333627, sum A070939.
%Y - Run-compression transform is A373948, sum A373953, excess A373954.
%Y - Ranks of contiguous compositions are A374249, counted by A274174.
%Y - Ranks of non-contiguous compositions are A374253, counted by A335548.
%Y Six types of maximal runs:
%Y - Count: A124766, A124765, A124768, A124769, A333381, A124767.
%Y - Rank: A375123, A375124, A375125, A375126, A375127, A373948.
%Y Cf. A029931, A228351, A233564, A238343, A272919, A373949, A374517, A374518, A374519, A374638.
%K nonn
%O 0,3
%A _Gus Wiseman_, Jul 31 2024