cp's OEIS Frontend

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.

A385887 The number k such that the k-th composition in standard order is the reversed sequence of lengths of maximal runs of binary indices of n.

This page as a plain text file.
%I A385887 #5 Jul 18 2025 08:30:45
%S A385887 0,1,1,2,1,3,2,4,1,3,3,6,2,5,4,8,1,3,3,6,3,7,6,12,2,5,5,10,4,9,8,16,1,
%T A385887 3,3,6,3,7,6,12,3,7,7,14,6,13,12,24,2,5,5,10,5,11,10,20,4,9,9,18,8,17,
%U A385887 16,32,1,3,3,6,3,7,6,12,3,7,7,14,6,13,12,24
%N A385887 The number k such that the k-th composition in standard order is the reversed sequence of lengths of maximal runs of binary indices of n.
%C A385887 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 A385887 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 A385887 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 A385887 The binary indices of 100 are {3,6,7}, with maximal runs ((3),(6,7)), with reversed lengths (2,1), which is the 5th composition in standard order, so a(100) = 5.
%t A385887 bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
%t A385887 stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
%t A385887 Table[stcinv[Reverse[Length/@Split[bpe[n],#2==#1+1&]]],{n,0,100}]
%Y A385887 Removing duplicates appears to give A232559, see also A348366, A358654, A385818.
%Y A385887 Sorted positions of firsts appearances appear to be A247648+1.
%Y A385887 The non-reverse version is A385889.
%Y A385887 A245563 lists run-lengths of binary indices (ranks A246029), reverse A245562.
%Y A385887 A384877 lists anti-run lengths of binary indices (ranks A385816), reverse A209859.
%Y A385887 Cf. A000120, A029931, A044813, A048793, A069010, A384175, A385817, A385886.
%K A385887 nonn
%O A385887 0,4
%A A385887 _Gus Wiseman_, Jul 17 2025