login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004752 Binary expansion contains 010. 6

%I #27 Apr 11 2021 04:52:23

%S 10,18,20,21,26,34,36,37,40,41,42,43,50,52,53,58,66,68,69,72,73,74,75,

%T 80,81,82,83,84,85,86,87,90,98,100,101,104,105,106,107,114,116,117,

%U 122,130,132,133,136,137,138,139,144,145,146,147,148,149,150

%N Binary expansion contains 010.

%H Indranil Ghosh, <a href="/A004752/b004752.txt">Table of n, a(n) for n = 1..32769</a>

%H <a href="/index/Ar#2-automatic">Index entries for 2-automatic sequences</a>.

%F a(n) ~ n. - _Charles R Greathouse IV_, Oct 23 2015

%e 20 is in the sequence because, 20 = 10100_2 and '10100' has '010' as one of its substrings. - _Indranil Ghosh_, Feb 11 2017

%t Select[Range@ 150, Length@ SequencePosition[IntegerDigits[#, 2], {0, 1, 0}] > 0 &] (* Version 10.1, or *)

%t Select[Range@ 150, MemberQ[Partition[IntegerDigits[#, 2], 3, 1], {0, 1, 0}] &] (* _Michael De Vlieger_, Feb 11 2017 *)

%o (Python)

%o i=j=0

%o while j<=100:

%o if "010" in bin(i)[2:]:

%o print(str(j)+" "+str(i))

%o j+=1

%o i+=1 # _Indranil Ghosh_, Feb 11 2017

%o (PARI) is(n)=while(n>9, if(bitand(n, 7)==2, return(1)); n>>=1); 0 \\ _Charles R Greathouse IV_, Feb 11 2017

%Y Cf. A004748, A004749, A004750, A004751, A004753.

%K nonn,base,easy

%O 1,1

%A _N. J. A. Sloane_

%E Offset corrected by _Charles R Greathouse IV_, Feb 11 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 18:16 EDT 2024. Contains 371916 sequences. (Running on oeis4.)