login
A087386
a(n) = smallest prime == 1 (mod P(n)) where P(n) is the n-th Palindrome.
2
2, 3, 7, 5, 11, 7, 29, 17, 19, 23, 23, 67, 89, 331, 67, 463, 89, 199, 607, 223, 727, 263, 283, 907, 967, 2053, 1087, 383, 607, 1061, 223, 233, 727, 757, 263, 1361, 283, 293, 607, 1879, 647, 1999, 1373, 4943, 727, 1493, 4597, 787, 809, 829, 1697, 1303, 1777
OFFSET
1,1
EXAMPLE
Prime corresponding to the palindrome 121 is 727.
PROG
(Python)
from itertools import count
from sympy import isprime
def A087386(n):
q =(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)
return next(p for p in count(q+1, q) if isprime(p)) # Chai Wah Wu, Jul 11 2024
CROSSREFS
Cf. A087387.
Sequence in context: A219789 A034694 A050921 * A110359 A092977 A057218
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Sep 09 2003
EXTENSIONS
More terms from David Wasserman, May 25 2005
STATUS
approved