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 A164702 #15 Jan 27 2019 03:01:25 %S A164702 4,6,8,9,10,14,16,18,18,21,20,21,22,27,32,33,34,35,36,42,38,39,40,49, %T A164702 42,51,44,45,46,55,64,65,66,69,68,69,70,75,72,81,74,75,76,77,78,87,80, %U A164702 81,82,99,84,85,86,87,88,105,90,91,92,93,94,95,128,129,130,133,132,133,134 %N A164702 Write n in binary. Insert one 0 right of any one 1. a(n) is the smallest possible composite equal to the value of any such resulting binary number. %H A164702 Michael De Vlieger, <a href="/A164702/b164702.txt">Table of n, a(n) for n = 2..16384</a> %e A164702 9 in binary is 1001. Putting a 0 after the first 1 results in 10001, which is 17 in decimal. Putting a 0 after the last 1 results in 10010, which is 18 in decimal. 17 is < 18, but 17 is prime. So a(9) = 18, a composite. %p A164702 rebase := proc(L,b) add( op(i,L)*b^(i-1),i=1..nops(L)) ; end proc: A164702 := proc(n) local bdg,a,p,bplu,newa ; bdg := convert(n,base,2) ; a := -1 ; for p from 1 to nops(bdg) do if op(p,bdg) = 1 then bplu := [op(1..p-1,bdg),0,op(p..nops(bdg),bdg)] ; newa := rebase(bplu,2) ; if newa > 3 and not isprime(newa) then if a = -1 or newa < a then a := newa ; end if; end if; end if; end do ; return a ; end proc: seq(A164702(n),n=2..100) ; # _R. J. Mathar_, Feb 27 2010 %t A164702 Table[With[{d = IntegerDigits[n, 2]}, SelectFirst[Map[FromDigits[#, 2] &@ Insert[d, 0, # + 1] &, Position[d, 1]], CompositeQ]], {n, 2, 70}] (* _Michael De Vlieger_, Sep 03 2017 *) %K A164702 base,nonn %O A164702 2,1 %A A164702 _Leroy Quet_, Aug 22 2009 %E A164702 Terms beyond a(13) from _R. J. Mathar_, Feb 27 2010