%I #11 Feb 01 2019 19:35:42
%S 1,6,7,20,21,22,23,28,29,30,31,72,73,74,75,76,77,78,79,88,89,90,91,92,
%T 93,94,95,104,105,106,107,108,109,110,111,120,121,122,123,124,125,126,
%U 127,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287
%N Those positive integers that when written in binary contain an odd number of digits, the middle digit being a 1.
%p isA175262 := proc(n) local dgs ; dgs := convert(n,base,2) ; if type(nops(dgs),'odd') then return ( op( (nops(dgs)+1)/2 ,dgs) = 1 ) ; else false ; end if; end proc: for n from 1 to 400 do if isA175262(n) then printf("%d,",n) ; end if; end do: # _R. J. Mathar_, Mar 29 2010
%t ondQ[n_]:=Module[{id=IntegerDigits[n,2],len},len=Length[id];OddQ[len] && id[[(len+1)/2]]==1]; Select[Range[300],ondQ] (* _Harvey P. Dale_, Apr 01 2018 *)
%Y Cf. A175263.
%K base,nonn
%O 1,2
%A _Leroy Quet_, Mar 16 2010
%E More terms from _R. J. Mathar_, Mar 29 2010
|