A375091 First element p of sexy prime pairs (p,p+6) whose concatenation is also prime.
11, 13, 17, 31, 83, 97, 101, 151, 157, 167, 223, 227, 233, 251, 257, 263, 271, 331, 353, 373, 433, 461, 541, 601, 653, 677, 727, 821, 823, 877, 941, 971, 1013, 1033, 1181, 1187, 1223, 1367, 1447, 1453, 1657, 1693, 1741, 1861, 1973, 1993, 1997, 2207, 2281, 2333, 2393, 2441
Offset: 1
Examples
11 is the first term, since (11,17) are sexy primes and 1117 is also prime. The second term is 13, since 1319 is prime.
Programs
-
Maple
q:= p-> andmap(isprime, [p, p+6, parse(cat(p, p+6))]): select(q, [$2..3000])[]; # Alois P. Heinz, Aug 02 2024
-
Mathematica
Select[Prime[Range[370]], PrimeQ[#+6] && PrimeQ[FromDigits[Join[IntegerDigits[#], IntegerDigits[#+6]]]] &] (* Stefano Spezia, Aug 03 2024 *)
-
PARI
isp(p) = isprime(p+6) && isprime(eval(concat(Str(p), Str(p+6)))) select(isp, primes(100)) \\ Michel Marcus, Aug 02 2024
-
Python
from sympy import isprime def ok(n): return isprime(n) and isprime(n+6) and isprime(int(str(n)+str(n+6))) print([k for k in range(2500) if ok(k)]) # Michael S. Branicky, Aug 01 2024