OFFSET
1,1
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
The first term is 5, since the prime triple (p,p+2,p+6) or (5,7,11) generates the prime number 5711 when the digits are concatenated. The fifth term is 307, since the prime triple (p,p+4,p+6) or (307,311,313) generates the prime number 307311313 when the digits are concatenated.
MATHEMATICA
Select[Partition[Prime[Range[6000]], 3, 1], #[[3]]-#[[1]]==6&&PrimeQ[FromDigits[Flatten[ IntegerDigits/@ #]]]&][[;; , 1]] (* Harvey P. Dale, Aug 21 2024 *)
PROG
(Python)
from itertools import islice
from sympy import isprime, nextprime
def agen(): # generator of terms
p, q, r = 2, 3, 5
while True:
if (q == p+2 or q == p+4) and r == p+6:
if isprime(int(str(p) + str(q) + str(r))):
yield p
p, q, r = q, r, nextprime(r)
print(list(islice(agen(), 41))) # Michael S. Branicky, Aug 18 2024
CROSSREFS
KEYWORD
nonn,base
AUTHOR
James S. DeArmon, Aug 11 2024
STATUS
approved