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.

A384878 Position of first appearance of n in the flattened version of the triangle A384877, whose m-th row lists the lengths of maximal anti-runs in the binary indices of m.

Original entry on oeis.org

1, 6, 34, 178, 882, 4210, 19570, 89202, 400498, 1776754
Offset: 1

Views

Author

Gus Wiseman, Jun 23 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.

Examples

			The set of binary indices of each nonnegative integer and its partition into anti-runs begins:
  0: {}      {{}}
  1: {1}     {{1}}
  2: {2}     {{2}}
  3: {1,2}   {{1},{2}}
  4: {3}     {{3}}
  5: {1,3}   {{1,3}}
  6: {2,3}   {{2},{3}}
  7: {1,2,3} {{1},{2},{3}}
The flattened version begins: {}, {1}, {2}, {1}, {2}, {3}, {1,3}, {2}, {3}, {1}, {2}, {3}. Of these sets, the first of length 2 is the sixth (starting with 0), so we have a(2) = 6.
		

Crossrefs

For runs instead of anti-runs we have A001792.
The unflattened version is A052499.
Positions of first appearances in A384877, see A000120, A245562, A245563, A384890.
A023758 lists differences of powers of 2.
A384175 counts subsets with all distinct lengths of maximal runs, complement A384176.

Programs

  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=Join@@Table[Length/@Split[bpe[n],#2!=#1+1&],{n,0,100}];
    Table[Position[q,i][[1,1]],{i,mnrm[q]}]