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.

A385816 The number k such that the k-th composition in standard order lists the maximal anti-run lengths of the binary indices of n. Standard composition number of row n of A384877.

Original entry on oeis.org

0, 1, 1, 3, 1, 2, 3, 7, 1, 2, 2, 6, 3, 5, 7, 15, 1, 2, 2, 6, 2, 4, 6, 14, 3, 5, 5, 13, 7, 11, 15, 31, 1, 2, 2, 6, 2, 4, 6, 14, 2, 4, 4, 12, 6, 10, 14, 30, 3, 5, 5, 13, 5, 9, 13, 29, 7, 11, 11, 27, 15, 23, 31, 63, 1, 2, 2, 6, 2, 4, 6, 14, 2, 4, 4, 12, 6, 10, 14
Offset: 0

Views

Author

Gus Wiseman, Jul 15 2025

Keywords

Comments

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.
If the k-th composition in standard order is y, then the standard composition number of y is defined to be k.

Examples

			The binary indices of 181 are {1,3,5,6,8}, with maximal anti-runs ((1,3,5),(6,8)), with lengths (3,2), which is the 18th composition in standard order, so a(181) = 18.
		

Crossrefs

The reverse version is A209859.
Sorted positions of first appearances are A247648.
These are standard composition numbers of rows of A384877 (duplicates removed A385886).
For runs instead of anti-runs the reverse is A385887 (duplicates removed A232559).
For runs instead of anti-runs we have A385889 (duplicates removed A385818).
A245563 lists run lengths of binary indices (ranks A246029), reverse A245562.

Programs

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