OFFSET
0,3
COMMENTS
FORMULA
a(p) = p if and only if p is prime.
EXAMPLE
a(4) = 3 since 43 is prime, a(25) = 13 since 25242322212019181716151413 is prime.
PROG
(Python)
from sympy import isprime
def A341701(n):
k, m = n, n-1
while not isprime(k) and m > 0:
k = int(str(k)+str(m))
m -= 1
return m+1 if isprime(k) else -1
CROSSREFS
KEYWORD
sign,base
AUTHOR
Chai Wah Wu, Feb 23 2021
STATUS
approved