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-2 of 2 results.

A164710 A positive integer n is included if all runs of 0's in binary n are of the same length.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 35, 36, 39, 42, 43, 45, 46, 47, 48, 49, 51, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 71, 73, 76, 79, 85, 86, 87, 90, 91, 93, 94, 95, 96, 97, 99, 100
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.
This sequence contains in part positive integers that each contain one run of 0's. For those members of this sequence each with at least two runs of 0's, see A164712.
Number of terms with n binary digits is A243815(n-1). - Robert Israel, Nov 09 2015

Crossrefs

Programs

  • Maple
    isA164710 := proc(n) local bdg,arl,lset ; bdg := convert(n,base,2) ; lset := {} ; arl := -1 ; for p from 1 to nops(bdg) do if op(p,bdg) = 0 then if p = 1 then arl := 1 ; else arl := arl+1 ; end if; else if arl > 0 then lset := lset union {arl} ; end if; arl := 0 ; end if; end do ; if arl > 0 then lset := lset union {arl} ; end if; return (nops(lset) <= 1 ); end proc: for n from 1 to 300 do if isA164710(n) then printf("%d,",n) ; end if; end do; # R. J. Mathar, Feb 27 2010
    F:= proc(d)
      local res,r,m,e,C,M;
      res:= [1$d];
      for r from 1 to floor(d/2) do
        for m from 1 to floor(d/r)-1 do
           e:= d - r*(m+1);
           for C in combinat:-choose(e+r,e) do
             M:= subsop(op(map(`=`,C,1)),[0$(e+r)]);
             res:= res, subs(0 = (1,0$m), M);
           od
        od
      od;
      sort(map(t -> add(t[-i]*2^(i-1),i=1..d), [res]));
    end proc:
    N:= 10: # to get all terms < 2^N
    map(op,[seq(F(d),d=1..N)]); # Robert Israel, Nov 09 2015
  • Mathematica
    Select[Range@ 100, SameQ @@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 0 &]] &] (* Michael De Vlieger, Aug 20 2017 *)
  • Perl
    foreach(1..100){
        %runs=();
        $runs{$}++ foreach split /1+/, sprintf("%b",$);
        delete $runs{''};
        print "$_, " if 1>=keys(%runs);
    }
    # Ivan Neretin, Nov 09 2015

Extensions

Terms beyond 39 by R. J. Mathar, Feb 27 2010

A164714 A positive integer n is included if all runs of 0's in binary n are of the same length, and if all runs of 1's in binary n are of the same length, and if there are at least two runs of 0's and at least two runs of 1's.

Original entry on oeis.org

10, 21, 36, 42, 54, 73, 85, 136, 170, 204, 219, 238, 273, 292, 341, 438, 528, 585, 682, 792, 819, 924, 990, 1057, 1365, 1755, 1911, 2080, 2184, 2340, 2730, 3120, 3171, 3276, 3510, 3640, 3822, 3900, 4030, 4161, 4369, 4681, 5461, 7399, 8256, 10922, 12384
Offset: 1

Views

Author

Leroy Quet, Aug 23 2009

Keywords

Comments

Clarification: A binary number consists of "runs" completely of 1's alternating with runs completely of 0's. No two or more runs all of the same digit are adjacent.
The length of each run of 1's may be different that the length of each run of 0's.
This sequence contains those positive integers in both sequence A164709 and sequence A164712.
The integers of this sequence, along with those positive integers that have (when written in binary) only one run of 0's and/or only one run of 1's, make up sequence A164713.

Crossrefs

Programs

  • Mathematica
    bslQ[n_]:=Module[{r=Split[IntegerDigits[n,2]]},Length[r]>3&&Length[ Union[ Length/@Take[r,{1,-1,2}]]]==1&&Length[Union[Length/@Take[r,{2,-1,2}]]] == 1]; Select[Range[13000],bslQ] (* Harvey P. Dale, Jan 13 2021 *)

Extensions

More terms from Sean A. Irvine, Sep 28 2009
Showing 1-2 of 2 results.