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.

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

This page as a plain text file.
%I A164707 #23 Oct 31 2019 14:33:00
%S A164707 1,2,3,4,5,6,7,8,9,10,12,14,15,16,17,18,20,21,24,27,28,30,31,32,33,34,
%T A164707 36,37,40,41,42,48,51,54,56,60,62,63,64,65,66,68,69,72,73,74,80,81,82,
%U A164707 84,85,96,99,102,108,112,119,120,124,126,127,128,129,130,132,133,136
%N A164707 A positive integer n is included if all runs of 1's in binary n are of the same length.
%C A164707 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.
%C A164707 This sequence contains in part positive integers that each contain one run of 1's. For those members of this sequence each with at least two runs of 1's, see A164709.
%H A164707 Ivan Neretin, <a href="/A164707/b164707.txt">Table of n, a(n) for n = 1..10000</a>
%e A164707 From _Gus Wiseman_, Oct 31 2019: (Start)
%e A164707 The sequence of terms together with their binary expansions and binary indices begins:
%e A164707    1:      1 ~ {1}
%e A164707    2:     10 ~ {2}
%e A164707    3:     11 ~ {1,2}
%e A164707    4:    100 ~ {3}
%e A164707    5:    101 ~ {1,3}
%e A164707    6:    110 ~ {2,3}
%e A164707    7:    111 ~ {1,2,3}
%e A164707    8:   1000 ~ {4}
%e A164707    9:   1001 ~ {1,4}
%e A164707   10:   1010 ~ {2,4}
%e A164707   12:   1100 ~ {3,4}
%e A164707   14:   1110 ~ {2,3,4}
%e A164707   15:   1111 ~ {1,2,3,4}
%e A164707   16:  10000 ~ {5}
%e A164707   17:  10001 ~ {1,5}
%e A164707   18:  10010 ~ {2,5}
%e A164707   20:  10100 ~ {3,5}
%e A164707   21:  10101 ~ {1,3,5}
%e A164707   24:  11000 ~ {4,5}
%e A164707   27:  11011 ~ {1,2,4,5}
%e A164707 (End)
%p A164707 isA164707 := 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) = 1 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 isA164707(n) then printf("%d,",n) ; end if; end do; # _R. J. Mathar_, Feb 27 2010
%t A164707 Select[Range@ 140, SameQ @@ Map[Length, Select[Split@ IntegerDigits[#, 2], First@ # == 1 &]] &] (* _Michael De Vlieger_, Aug 20 2017 *)
%o A164707 (Perl)
%o A164707 foreach(1..140){
%o A164707     %runs=();
%o A164707     $runs{$_}++ foreach split /0+/, sprintf("%b",$_);
%o A164707     print "$_, " if 1==keys(%runs);
%o A164707 }
%o A164707 # _Ivan Neretin_, Nov 09 2015
%Y A164707 Cf. A164708, A164709, A164710.
%Y A164707 The version for prime indices is A072774.
%Y A164707 The binary expansion of n has A069010(n) runs of 1's.
%Y A164707 Numbers whose runs are all of different lengths are A328592.
%Y A164707 Partitions with equal multiplicities are A047966.
%Y A164707 Numbers whose binary expansion is aperiodic are A328594.
%Y A164707 Numbers whose reversed binary expansion is a necklace are A328595.
%Y A164707 Numbers whose reversed binary expansion is a Lyndon word are A328596.
%Y A164707 Cf. A000120, A003714, A014081, A065609, A070939, A121016, A245563, A275692.
%K A164707 base,nonn
%O A164707 1,2
%A A164707 _Leroy Quet_, Aug 23 2009
%E A164707 Extended beyond 42 by _R. J. Mathar_, Feb 27 2010