This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A385889 #7 Jul 18 2025 08:30:38 %S A385889 0,1,1,2,1,3,2,4,1,3,3,5,2,6,4,8,1,3,3,5,3,7,5,9,2,6,6,10,4,12,8,16,1, %T A385889 3,3,5,3,7,5,9,3,7,7,11,5,13,9,17,2,6,6,10,6,14,10,18,4,12,12,20,8,24, %U A385889 16,32,1,3,3,5,3,7,5,9,3,7,7,11,5,13,9,17,3 %N A385889 The number k such that the k-th composition in standard order is the sequence of lengths of maximal runs of binary indices of n. %C A385889 A binary index of n is any position of a 1 in its reversed binary expansion. The binary indices of n are row n of A048793. %C A385889 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 A385889 Gus Wiseman, <a href="https://docs.google.com/document/d/e/2PACX-1vTCPiJVFUXN8IqfLlCXkgP15yrGWeRhFS4ozST5oA4Bl2PYS-XTA3sGsAEXvwW-B0ealpD8qnoxFqN3/pub">Statistics, classes, and transformations of standard compositions</a> %e A385889 The binary indices of 27 are {1,2,4,5}, with maximal runs ((1,2),(4,5)), with lengths (2,2), which is the 10th composition in standard order, so a(27) = 10. %e A385889 The binary indices of 100 are {3,6,7}, with maximal runs ((3),(6,7)), with lengths (1,2), which is the 6th composition in standard order, so a(100) = 6. %t A385889 bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1]; %t A385889 stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2; %t A385889 Table[stcinv[Length/@Split[bpe[n],#2==#1+1&]],{n,0,100}] %Y A385889 Sorted positions of firsts appearances appear to be A247648+1. %Y A385889 After removing duplicates we get A385818. %Y A385889 The reverse version is A385887. %Y A385889 A245563 lists run lengths of binary indices (ranks A246029), reverse A245562. %Y A385889 A384877 lists anti-run lengths of binary indices (ranks A385816), reverse A209859. %Y A385889 Cf. A000120, A023758, A029931, A044813, A048793, A069010, A348366, A384175, A384878, A385817. %K A385889 nonn %O A385889 0,4 %A A385889 _Gus Wiseman_, Jul 16 2025