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

A249380
Prime numbers Q such that the concatenation Q,8,Q is prime.
3
3, 7, 19, 61, 67, 109, 139, 277, 337, 349, 523, 547, 727, 751, 823, 853, 859, 883, 991, 1009, 1063, 1093, 1231, 1237, 1279, 1291, 1321, 1423, 1429, 1447, 1531, 1609, 1657, 1723, 1759, 1867, 1933, 1951, 2089, 2113, 2131, 2683
OFFSET
1,1
EXAMPLE
383 is prime so a(1)=3.
585 is composite, 787 is prime so a(2)=7.
PROG
(PFGW & SCRIPT), the pre10.txt file with the first 10000000 prime numbers.
SCRIPT
DIM i, 0
DIM j
DIM k
DIM n, 1
OPENFILEOUT myf, a(n).txt
OPENFILEIN maf, pre10.txt
GETNEXT j, maf
LABEL loop1
GETNEXT j, maf
IF j>10^n THEN SET n, n+1
SET k, j*10^(n+1)+8*10^n+j
PRP k
IF ISPRP THEN GOTO w
GOTO loop1
LABEL w
SET i, i+1
WRITE myf, j
IF i>9999 THEN END
GOTO loop1
(PARI) lista(nn) = {forprime(p=1, nn, if (isprime(eval(concat(concat(Str(p), 8), Str(p)))), print1(p, ", ")); ); } \\ Michel Marcus, Oct 27 2014
(Magma) [p: p in PrimesUpTo(3000) | IsPrime(Seqint(Intseq(p) cat [8] cat Intseq(p)))]; // Vincenzo Librandi, Oct 27 2014
CROSSREFS
Cf. similar sequences listed in A249374.
Sequence in context: A148667 A148668 A148669 * A364626 A210985 A160128
KEYWORD
nonn,base
AUTHOR
Pierre CAMI, Oct 27 2014
STATUS
approved