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.

A385818 The number k such that the k-th composition in standard order lists the maximal run lengths of each nonnegative integer's binary indices, with duplicates removed.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 12, 16, 11, 13, 17, 14, 18, 20, 24, 32, 15, 19, 21, 25, 33, 22, 26, 34, 28, 36, 40, 48, 64, 23, 27, 35, 29, 37, 41, 49, 65, 30, 38, 42, 50, 66, 44, 52, 68, 56, 72, 80, 96, 128, 31, 39, 43, 51, 67, 45, 53, 69, 57, 73, 81, 97
Offset: 0

Views

Author

Gus Wiseman, Jul 18 2025

Keywords

Comments

A permutation of the nonnegative integers.
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.
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.

Examples

			The binary indices of 53 are {1,3,5,6}, with maximal runs ((1),(3),(5,6)) with lengths (1,1,2), which is the 14th composition in standard order, so A385889(53) = 14, and after removing duplicate rows a(16) = 14.
		

Crossrefs

For anti-runs instead of runs we appear to have A348366.
See also A385816 (standard compositions of rows of A384877), reverse A209859.
The compositions themselves are listed by A385817.
Before removing duplicates we had A385889.
A245563 lists run lengths of binary indices (ranks A246029), rev A245562, strict A328592.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    stcinv/@DeleteDuplicates[Table[Length/@Split[bpe[n],#2==#1+1&],{n,0,100}]]