Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Jun 20 2014 09:22:59
%S 1117,2111,4111,8111,10111,11113,11117,11119,11131,11149,11159,11161,
%T 11171,11173,11177,11197,16111,22111,25111,26111,28111,35111,40111,
%U 41113,41117,44111,47111,50111,58111,65111,68111,70111,71119,79111,80111
%N Prime numbers containing the string 111.
%H Vincenzo Librandi, <a href="/A243527/b243527.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) ~ n log n. - _Charles R Greathouse IV_, Jun 20 2014
%t Select[Prime[Range[90000]], !StringFreeQ[ToString[#], "111"]&]
%o (PARI) contains(n,k)=my(N=digits(n),K=digits(k)); for(i=0,#N-#K, for(j=1,#K,if(N[i+j]!=K[j],next(2))); return(1)); 0
%o is(n)=isprime(n) && contains(n,111) \\ _Charles R Greathouse IV_, Jun 20 2014
%Y Cf. prime numbers containing the string kkk: this sequence (k=1), A166580 (k=2), A166581 (k=3), A166582 (k=4), A167281 (k=5), A131645 (k=6), A167282 (k=7), A167290 (k=8), A167292 (k=9).
%K nonn,base,easy
%O 1,1
%A _Vincenzo Librandi_, Jun 06 2014