login
A110786
To obtain a(n), take the n-th palindrome P = A002113(n) and concatenate it with the smallest palindrome Q such that PQ is a prime.
2
11, 23, 31, 41, 53, 61, 71, 83, 97, 113, 223, 331, 443, 557, 661, 773, 881, 991, 1013, 1117, 1213, 1319, 14177, 1511, 1613, 171131, 1811, 1913, 2027, 2129, 2221, 232171, 2423, 2521, 2621, 2729, 28211, 2927, 3037, 3137, 32377, 3331, 3433, 3533
OFFSET
1,1
EXAMPLE
The palindrome 171 gives a prime 171131 when concatenated with 131 and no palindrome less than 131 gives a prime on concatenation: 1711,1713,1717,1719,17111, etc. up to 171121 are all composite.
PROG
(Python)
from itertools import count
from sympy import isprime
def A110786(n):
s = str((c:=n+1-x)*x+int(str(c)[-2::-1] or 0) if n+1<(x:=10**(len(str(n+1>>1))-1))+(y:=10*x) else (c:=n+1-y)*y+int(str(c)[::-1] or 0))
for k in count(2):
if isprime(pq:=int(s+str((c:=k-x)*x+int(str(c)[-2::-1] or 0) if k<(x:=10**(len(str(k>>1))-1))+(y:=10*x) else (c:=k-y)*y+int(str(c)[::-1] or 0)))):
return pq # Chai Wah Wu, Jul 10 2024
CROSSREFS
Sequence in context: A077501 A337845 A030675 * A059642 A090920 A344175
KEYWORD
base,easy,nonn
AUTHOR
Amarnath Murthy, Aug 12 2005
EXTENSIONS
More terms from Giovanni Resta, Feb 08 2006
Edited by N. J. A. Sloane, Jan 16 2009
STATUS
approved