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.
%I A004742 #24 Feb 13 2022 06:37:08 %S A004742 0,1,2,3,4,6,7,8,9,12,14,15,16,17,18,19,24,25,28,30,31,32,33,34,35,36, %T A004742 38,39,48,49,50,51,56,57,60,62,63,64,65,66,67,68,70,71,72,73,76,78,79, %U A004742 96,97,98,99,100,102,103,112,113,114,115,120,121,124,126,127 %N A004742 Numbers whose binary expansion does not contain 101. %H A004742 Charles R Greathouse IV, <a href="/A004742/b004742.txt">Table of n, a(n) for n = 1..10000</a> %H A004742 Robert Baillie and Thomas Schmelzer, <a href="https://library.wolfram.com/infocenter/MathSource/7166/">Summing Kempner's Curious (Slowly-Convergent) Series</a>, Mathematica Notebook kempnerSums.nb, Wolfram Library Archive, 2008. %H A004742 <a href="/index/Ar#2-automatic">Index entries for 2-automatic sequences</a>. %F A004742 Sum_{n>=2} 1/a(n) = 6.198475910942069028389983717965787117743378665090593775808705963863146498248... (calculated using Baillie and Schmelzer's kempnerSums.nb, see Links). - _Amiram Eldar_, Feb 13 2022 %t A004742 Select[Range[0, 130], !StringContainsQ[IntegerString[#, 2], "101"] &] (* _Amiram Eldar_, Feb 13 2022 *) %o A004742 (PARI) is(n)=n=binary(n);for(i=3,#n,if(n[i]&&n[i-2]&&!n[i-1],return(0))); 1 \\ _Charles R Greathouse IV_, Mar 26 2013 %o A004742 (PARI) is(n)=while(n>4, if(bitand(n,7)==5, return(0)); n>>=1); 1 \\ _Charles R Greathouse IV_, Feb 11 2017 %o A004742 (PARI) is(n)=!bitand(bitand(n,n>>2),bitneg(n>>1)) \\ _Charles R Greathouse IV_, Oct 28 2021 %o A004742 (PARI) searchLE(S,x)=my(t=setsearch(S,x)); if(t,t,setsearch(S,x,1)-1); \\ finds last element <= x %o A004742 expand(~v, lim)=my(b=exponent(v[#v]+1), B=1<<b, mx=searchLE(v,lim-B), block1=setsearch(v,B\4-1), block2=setsearch(v,B\2)); for(i=1, min(block1,mx), listput(v,B+v[i])); for(i=block2,mx, listput(v,B+v[i])); if(v[#v]>lim, listpop(~v)); %o A004742 list(lim)=lim\=1; if(lim<5, return(if(lim<0,[],[0..lim]))); my(v=List([0..3])); for(b=3,exponent(lim+1), expand(~v, 2^b-1)); expand(~v, lim); Vec(v) %o A004742 (Haskell) %o A004742 a004742 n = a004742_list !! (n-1) %o A004742 a004742_list = filter f [0..] where %o A004742 f x = x < 4 || x `mod` 8 /= 5 && f (x `div` 2) %o A004742 -- _Reinhard Zumkeller_, Jul 01 2013 %Y A004742 Cf. A007088; A003796 (no 000), A004745 (no 001), A004746 (no 010), A004744 (no 011), A003754 (no 100), A004743 (no 110), A003726 (no 111). %K A004742 nonn,base,easy %O A004742 1,3 %A A004742 _N. J. A. Sloane_