login
A249377
Prime numbers Q such that the concatenation Q,4,Q is prime.
3
11, 17, 29, 53, 71, 107, 113, 179, 239, 263, 293, 317, 347, 401, 419, 503, 557, 569, 641, 659, 809, 857, 863, 941, 953, 983, 1049, 1103, 1277, 1301, 1319, 1439, 1487, 1553, 1613, 1667, 1733, 1877, 1889, 1901, 1907, 1949, 2243, 2381, 2447, 2477, 2687, 2693
OFFSET
1,1
EXAMPLE
343 is composite, 545 is composite, 747 is composite, 11411 is prime so a(1)=11.
MATHEMATICA
Select[Prime[Range[300]], PrimeQ[FromDigits[Join[IntegerDigits[#], {4}, IntegerDigits[ #]]]]&] (* Harvey P. Dale, Aug 01 2016 *)
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)+4*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), 4), Str(p)))), print1(p, ", ")); ); } \\ Michel Marcus, Oct 27 2014
(Magma) [p: p in PrimesUpTo(3000) | IsPrime(Seqint(Intseq(p) cat [4] cat Intseq(p)))]; // Vincenzo Librandi, Oct 27 2014
(Python)
from sympy import isprime, primerange
def ok(p): s = str(p); return isprime(int(s + "4" + s))
def aupto(limit): return [p for p in primerange(1, limit+1) if ok(p)]
print(aupto(2700)) # Michael S. Branicky, Nov 17 2021
CROSSREFS
Cf. similar sequences listed in A249374.
Sequence in context: A060213 A234098 A153502 * A211486 A208573 A142718
KEYWORD
nonn,base
AUTHOR
Pierre CAMI, Oct 27 2014
STATUS
approved