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 A208241 #15 Nov 15 2020 02:01:14 %S A208241 2,5,7,17,11,13,29,17,19,41,23,97,53,29,31,67,71,37,79,41,43,89,47,97, %T A208241 101,53,109,113,59,61,127,131,67,137,71,73,149,307,79,163,83,337,173, %U A208241 89,181,373,191,97,197,101,103,211,107,109,223,113,229,233,239 %N A208241 Smallest prime greater than n, with n as prefix in binary representation. %C A208241 A208238(n) <= a(n); %C A208241 A174332(n) = a(A000040(n)). %H A208241 Reinhard Zumkeller, <a href="/A208241/b208241.txt">Table of n, a(n) for n = 1..10000</a> %p A208241 A208241 := proc(n) %p A208241 local nbin,len,suf,sufbin,pbin,p ; %p A208241 nbin := convert(n,base,2) ; %p A208241 for len from 1 do %p A208241 for suf from 0 to 2^len-1 do %p A208241 sufbin := convert(suf,base,2) ; %p A208241 while nops(sufbin) < len do %p A208241 sufbin := [op(sufbin),0] ; %p A208241 end do: %p A208241 pbin := [op(sufbin),op(nbin)] ; %p A208241 p := add( 2^(i-1)*op(i,pbin),i=1..nops(pbin) ) ; %p A208241 if isprime(p) then %p A208241 return p ; %p A208241 end if; %p A208241 end do: %p A208241 end do: %p A208241 end proc: %p A208241 seq(A208241(n),n=1..50) ; # _R. J. Mathar_, May 06 2017 %o A208241 (Haskell) %o A208241 import Data.List (genericIndex, find, isPrefixOf) %o A208241 import Data.Maybe (fromJust) %o A208241 a208241 = genericIndex a208241_list %o A208241 a208241_list = f nns $ filter ((== 1) . a010051' . fst) nns where %o A208241 f mms'@((m,ms):mms) pps'@((p,ps):pps) = %o A208241 if m == p then f mms' pps else q : f mms pps' %o A208241 where q = fst $ fromJust $ find ((ms `isPrefixOf`) . snd) pps' %o A208241 nns = zip [1..] $ map reverse $ tail a030308_tabf %Y A208241 Cf. A208238, A004676, A007088, A010051, A030308, A055011 (iterated). %Y A208241 Cf. A164022 (greater or equal). %K A208241 nonn,base %O A208241 1,1 %A A208241 _Reinhard Zumkeller_, Feb 14 2013