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 A166580 #29 Jul 16 2025 13:35:38 %S A166580 2221,12227,22229,22247,22259,22271,22273,22277,22279,22283,22291, %T A166580 42221,42223,42227,52223,72221,72223,72227,72229,82223,92221,92227, %U A166580 102229,112223,122201,122203,122207,122209,122219,122231,122251,122263,122267,122273,122279,122299,132229,142223 %N A166580 Prime numbers containing the string 222. %H A166580 Vincenzo Librandi, <a href="/A166580/b166580.txt">Table of n, a(n) for n = 1..1000</a> %F A166580 a(n) ~ n log n. - _Charles R Greathouse IV_, Jun 20 2014 %t A166580 p222Q[n_] := Module[{idn = IntegerDigits[n]}, MemberQ[Partition[idn, 3, 1], {2, 2, 2}]]; Select[Prime[Range[15000]], p222Q] (* _Vincenzo Librandi_ Sep 14 2012 *) %t A166580 Select[Prime[Range[12000]],SequenceCount[IntegerDigits[#],{2,2,2}]>0&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Nov 08 2017 *) %o A166580 (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 A166580 is(n)=isprime(n) && contains(n,222) \\ _Charles R Greathouse IV_, Jun 20 2014 %o A166580 (Magma) res := []; for n in [1..15000] do p := NthPrime(n); digits := IntegerToSequence(p); for i in [1..#digits - 2] do if digits[i..i+2] eq [2,2,2] then Append(~res, p); break; end if; end for; end for; res; // _Vincenzo Librandi_, Jul 16 2025 %Y A166580 Cf. A243527, A166581, A166582, A167281, A131645, A167282, A167290, A167292. %K A166580 nonn,base %O A166580 1,1 %A A166580 _Vincenzo Librandi_, Nov 01 2009