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.

A333767 Length of shortest run of zeros after a one in the binary expansion of n. a(0) = 0.

Original entry on oeis.org

0, 0, 1, 0, 2, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 4, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 1, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 1, 0, 2, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0
Offset: 0

Views

Author

Gus Wiseman, Apr 06 2020

Keywords

Examples

			The binary expansion of 148 is (1,0,0,1,0,1,0,0), so a(148) = 1.
		

Crossrefs

Positions of first appearances (ignoring index 0) are A000079.
Positions of terms > 0 are A022340.
Minimum prime index is A055396.
The maximum part minus 1 is given by A087117.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Compositions without 1's are A022340.
- Sum is A070939.
- Product is A124758.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Runs-resistance is A333628.
- Maximum is A333766.
- Minimum is A333768.
- Weakly decreasing compositions are A114994.
- Weakly increasing compositions are A225620.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[If[n==0,0,Min@@stc[n]-1],{n,0,100}]

Formula

For n > 0, a(n) = A333768(n) - 1.