login
A380010
Beginning with 7, least prime such that concatenation of the first n terms is prime.
2
7, 3, 3, 3, 31, 23, 13, 3, 167, 13, 137, 3, 73, 383, 499, 431, 13, 101, 61, 47, 67, 101, 13, 83, 1237, 107, 97, 467, 499, 677, 1423, 353, 73, 431, 331, 683, 487, 2141, 3, 1753, 1787, 31, 443, 139, 653, 1327, 17, 919, 173, 2851, 137, 547, 557, 5167, 347, 7867, 839, 19, 179, 19
OFFSET
1,1
LINKS
J.W.L. (Jan) Eerland, Table of n, a(n) for n = 1..1000
MATHEMATICA
w={7}; Do[k=1; q=Monitor[Parallelize[While[True, If[PrimeQ[FromDigits[Join@@IntegerDigits/@Append[w, Prime[k]]]], Break[]]; k++]; Prime[k]], k]; w=Append[w, q], {i, 2, 50}]; w
PROG
(Python)
from itertools import count, islice
from gmpy2 import digits, is_prime, mpz, next_prime
def agen(): # generator of terms
s, an = "", 7
while True:
yield int(an)
s += digits(an)
p = 3
while not is_prime(mpz(s+digits(p))): p = next_prime(p)
an = p
print(list(islice(agen(), 50))) # after Michael S. Branicky in A379354
KEYWORD
base,nonn
AUTHOR
STATUS
approved