OFFSET
1,2
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
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..10000
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 *)
PROG
(Perl)
foreach(1..100){
%runs=();
$runs{$_}++ foreach split /1+/, sprintf("%b", $_);
delete $runs{''};
print "$_, " if 1>=keys(%runs);
}
# Ivan Neretin, Nov 09 2015
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Leroy Quet, Aug 23 2009
EXTENSIONS
Terms beyond 39 by R. J. Mathar, Feb 27 2010
STATUS
approved