login
Prime p concatenated with next 4 primes is also prime.
6

%I #13 Jan 26 2023 18:02:21

%S 7,47,53,67,97,101,149,401,431,479,487,757,827,887,1061,1171,1409,

%T 1429,1543,1721,1789,1811,1889,1987,2099,2113,2137,2273,2689,2719,

%U 2857,3203,3571,3613,3623,3761,3853,3917,3929,4007,4217,4441,4943,5039,5209,5281,5449

%N Prime p concatenated with next 4 primes is also prime.

%H Michael S. Branicky, <a href="/A086040/b086040.txt">Table of n, a(n) for n = 1..10000</a>

%e a(1) = 7 because 7, 11, 13, 17 and 19 concatenated together yield 711131719, which is prime.

%o (Python)

%o from itertools import islice

%o from sympy import isprime, nextprime

%o def agen(): # generator of terms

%o plst = [2, 3, 5, 7, 11]

%o slst = list(map(str, plst))

%o while True:

%o if isprime(int("".join(slst))):

%o yield plst[0]

%o plst = plst[1:] + [nextprime(plst[-1])]

%o slst = slst[1:] + [str(plst[-1])]

%o print(list(islice(agen(), 50))) # _Michael S. Branicky_, Jan 26 2023

%Y Cf. A030459, A030468, A030472, A086041.

%K base,nonn

%O 1,1

%A Chuck Seggelin (barkeep(AT)plastereddragon.com), Jul 07 2003

%E Offset corrected by _Arkadiusz Wesolowski_, May 10 2012

%E a(15) and beyond from _Michael S. Branicky_, Jan 26 2023