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.

Showing 1-3 of 3 results.

A144790 Consider the runs of 1's in the binary representation of n, each of these runs being on the edge of the binary representation n and/or being bounded by 0's. a(n) = the length of the shortest such run of 1's in binary n.

Original entry on oeis.org

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

Views

Author

Leroy Quet, Sep 21 2008

Keywords

Examples

			19 in binary is 10011. The runs of 1's are as follows: (1)00(11). The shortest of these runs contains exactly one 1. So a(19) = 1.
		

Crossrefs

Programs

  • Mathematica
    Array[Min@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 1 &]] &, 105] (* Michael De Vlieger, Oct 26 2017 *)

Extensions

Extended by Ray Chandler, Nov 04 2008

A144794 A positive integer n is included if every 0 in binary n is next to at least one other 0.

Original entry on oeis.org

4, 8, 9, 12, 16, 17, 19, 24, 25, 28, 32, 33, 35, 36, 39, 48, 49, 51, 56, 57, 60, 64, 65, 67, 68, 71, 72, 73, 76, 79, 96, 97, 99, 100, 103, 112, 113, 115, 120, 121, 124, 128, 129, 131, 132, 135, 136, 137, 140, 143, 144, 145, 147, 152, 153, 156, 159, 192, 193, 195, 196
Offset: 1

Views

Author

Leroy Quet, Sep 21 2008

Keywords

Comments

n is included if A144789(n) >= 2.

Crossrefs

Programs

  • Maple
    A007814 := proc(n) local nshf,a ; a := 0 ; nshf := n ; while nshf mod 2 = 0 do nshf := nshf/2 ; a := a+1 ; od: a ; end: A144789 := proc(n) option remember ; local lp2,lp2sh,bind ; bind := convert(n,base,2) ; if add(i,i=bind) = nops(bind) then RETURN(0) ; fi; lp2 := A007814(n) ; if lp2 = 0 then A144789(floor(n/2)) ; else lp2sh := A144789(n/2^lp2) ; if lp2sh = 0 then lp2 ; else min(lp2,lp2sh) ; fi; fi; end: isA144794 := proc(n) RETURN(A144789(n) >= 2) ; end: for n from 3 to 400 do if isA144794(n) then printf("%d,",n) ; fi; od: # R. J. Mathar, Sep 29 2008
  • Mathematica
    Select[Range@ 200, And[Union@ # != {1}, AllTrue[Map[Length, Select[Split@ #, First@ # == 0 &]], # > 1 &]] &@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Aug 20 2017 *)

Extensions

Extended by R. J. Mathar, Sep 29 2008

A144793 Consider the runs of 0's in the binary representation of n, each of these runs being on the edge of the binary representation n and/or being bounded by 1's. Consider also the runs of 1's in the binary representation of n, each of these runs being on the edge of the binary representation n and/or being bounded by 0's. A positive integer n is included in this sequence if the length of the shortest such run of 0's in binary n equals the length of the shortest such run of 1's in binary n.

Original entry on oeis.org

2, 5, 10, 11, 12, 13, 18, 20, 21, 22, 23, 26, 29, 34, 37, 38, 40, 41, 42, 43, 44, 45, 46, 47, 50, 51, 52, 53, 56, 58, 61, 66, 69, 70, 74, 75, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 98, 101, 103, 104, 105, 106, 107, 109, 114, 115, 116, 117
Offset: 1

Views

Author

Leroy Quet, Sep 21 2008, Oct 07 2008

Keywords

Comments

This sequence contains those positive integers m where A144789(m) = A144790(m).

Examples

			1564 in binary is 11000011100. The runs of 0's are like this: 11(0000)111(00). The runs of 1's are like this: (11)0000(111)00. The shortest run of 0's contains two 0's. The shortest run of 1's contains two 1's. Since both the shortest run of 0's and the shortest run of 1's are of the same length, 1564 is included in this sequence.
		

Crossrefs

Extensions

Extended by Ray Chandler, Nov 04 2008
Showing 1-3 of 3 results.