login
A004751
Binary expansion contains 001.
5
9, 17, 18, 19, 25, 33, 34, 35, 36, 37, 38, 39, 41, 49, 50, 51, 57, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 89, 97, 98, 99, 100, 101, 102, 103, 105, 113, 114, 115, 121, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139
OFFSET
1,1
FORMULA
a(n) ~ n. - Charles R Greathouse IV, Oct 23 2015
EXAMPLE
19 is in the sequence because 19 = 10011_2 and '10011' has '001' as one of its substrings. - Indranil Ghosh, Feb 11 2017
MATHEMATICA
Select[Range@ 139, Length@ SequencePosition[IntegerDigits[#, 2], {0, 0, 1}] > 0 &] (* Version 10.1, or *)
Select[Range@ 139, MemberQ[Partition[IntegerDigits[#, 2], 3, 1], {0, 0, 1}] &] (* Michael De Vlieger, Feb 11 2017 *)
Select[Range[150], SequenceCount[IntegerDigits[#, 2], {0, 0, 1}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 15 2018 *)
PROG
(Python)
i=j=0
while j<=100:
if "001" in bin(i)[2:]:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 11 2017
(PARI) is(n)=while(n>8, if(bitand(n, 7)==1, return(1)); n>>=1); 0 \\ Charles R Greathouse IV, Feb 11 2017
CROSSREFS
KEYWORD
nonn,base,easy
EXTENSIONS
Offset corrected by Charles R Greathouse IV, Feb 11 2017
STATUS
approved