[go: up one dir, main page]

login

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”).

A166580
Prime numbers containing the string 222.
9
2221, 12227, 22229, 22247, 22259, 22271, 22273, 22277, 22279, 22283, 22291, 42221, 42223, 42227, 52223, 72221, 72223, 72227, 72229, 82223, 92221, 92227, 102229, 112223, 122201, 122203, 122207, 122209, 122219, 122231, 122251, 122263, 122267
OFFSET
1,1
LINKS
FORMULA
a(n) ~ n log n. - Charles R Greathouse IV, Jun 20 2014
MATHEMATICA
p222Q[n_] := Module[{idn = IntegerDigits[n]}, MemberQ[Partition[idn, 3, 1], {2, 2, 2}]]; Select[Prime[Range[15000]], p222Q] (* Vincenzo Librandi Sep 14 2012 *)
Select[Prime[Range[12000]], SequenceCount[IntegerDigits[#], {2, 2, 2}]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 08 2017 *)
PROG
(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
is(n)=isprime(n) && contains(n, 222) \\ Charles R Greathouse IV, Jun 20 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vincenzo Librandi, Nov 01 2009
STATUS
approved