login
Smallest prime p, larger than previous term, such that concatenation of n and p is a prime.
1

%I #8 May 25 2024 20:46:04

%S 3,11,13,19,23,31,43,53,67,97,113,149,151,173,193,223,239,251,373,389,

%T 397,409,431,439,457,479,487,499,569,577,601,647,739,757,797,809,811,

%U 821,827,829,863,929,991,1109,1181,1297,1301,1303,1327,1367,1409,1429

%N Smallest prime p, larger than previous term, such that concatenation of n and p is a prime.

%C Cf. A096915.

%e a(10)=97 because 1097 is prime, while 1071,1073,1079,1083,1089 are all composite.

%o (Python)

%o from sympy import isprime, nextprime

%o def ispal(n): s = str(n); return s == s[::-1]

%o def aupto(lim):

%o n, p, alst = 1, 2, []

%o while p <= lim:

%o if isprime(int(str(n)+str(p))): n, alst = n + 1, alst + [p]

%o p = nextprime(p)

%o return alst

%o print(aupto(1429)) # _Michael S. Branicky_, Mar 11 2021

%Y Cf. A096915, A103836.

%K nonn,base

%O 1,1

%A _Zak Seidov_, Mar 30 2005