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

Prime numbers Q such that the concatenation Q,d,Q is prime for at least one d in the set {1, 2, 3, 4, 5, 6, 7, 8, 9}.
1

%I #24 Dec 21 2016 16:30:12

%S 3,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,

%T 107,109,113,127,131,137,139,149,151,163,167,173,179,191,193,197,211,

%U 223,229,233,239,241,257,263,269,277,281,283,293,313

%N Prime numbers Q such that the concatenation Q,d,Q is prime for at least one d in the set {1, 2, 3, 4, 5, 6, 7, 8, 9}.

%H Pierre CAMI, <a href="/A249373/b249373.txt">Table of n, a(n) for n = 1..10000</a>

%e 313, 353, 373 as 383 are prime numbers so a(1)=3.

%e 727, 757, 787 as 797 are prime numbers so a(2)=7.

%t Select[Prime[Range[100]],AnyTrue[FromDigits/@Table[Join[ IntegerDigits[ #], {n},IntegerDigits[#]],{n,9}],PrimeQ]&] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Dec 21 2016 *)

%o (PFGW & SCRIPT), pre10.txt file with the first 10000000 prime numbers.

%o SCRIPT

%o DIM i,0

%o DIM j

%o DIM k

%o DIM n,1

%o DIM o

%o OPENFILEOUT myf,a(n).txt

%o OPENFILEIN maf,pre10.txt

%o GETNEXT j,maf

%o LABEL loop1

%o GETNEXT j,maf

%o IF j>10^n THEN SET n,n+1

%o SET o,0

%o LABEL loop2

%o SET o,o+1

%o IF o>9 THEN GOTO loop1

%o SET k,j*10^(n+1)+o*10^n+j

%o PRP k

%o IF ISPRP THEN GOTO w

%o GOTO loop2

%o LABEL w

%o SET i,i+1

%o WRITE myf,j

%o IF i>9999 THEN END

%o GOTO loop1

%o (PARI) lista(nn) = {forprime(p=2, nn, len = #Str(p); if (sum(i=1, 9, isprime(p+(10*p+i)*10^len)), print1(p, ", ")););} \\ _Michel Marcus_, Oct 28 2014

%Y Cf. A249350, A249374, A249375, A249376, A249377, A249378, A249379, A249380, A249381.

%K nonn,base

%O 1,1

%A _Pierre CAMI_, Oct 27 2014