login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A341932
a(n) = largest k < n such that the decimal concatenation n||n-1||n-2||...||n-k is prime, or -1 if no such prime exists.
2
-1, -1, 0, 0, 1, 0, -1, 4, -1, -1, 3, 0, -1, 0, -1, -1, -1, 0, -1, 0, -1, -1, 3, 0, 1, 12, -1, 4, -1, 0, -1, 0, -1, -1, 1, -1, -1, 0, -1, -1, -1, 0, 1, 0, -1, -1, 43, 0, 31, -1, -1, 4, 15, 12, -1, 28, 9, -1, 1, 0, 13, 0, -1, -1, -1, -1, -1, 0, 57, -1, 1, 0, -1
OFFSET
0,8
COMMENTS
a(82) = 81, are there any other n such that a(n) = n-1?
Primes p such that a(p) > 0: 7, 53, 73, 79, 89, 103, ...
n such that a(n) > A341702(n): 7, 10, 22, 46, 48, 53, 55, 73, ...
Similar argument as in A341716 shows that if n > 3 and a(n) >= 0, then n-a(n) is odd, a(n) !== 2 (mod 3) and 2n-a(n) !== 0 (mod 3).
FORMULA
a(n) = n-A341931(n) >= A341702(n).
EXAMPLE
a(22) = 3 since 22212019 is prime.
PROG
(Python)
from sympy import isprime
def A341932(n):
k, m, r = n, n-1, 0 if isprime(n) else -1
while m > 0:
k = int(str(k)+str(m))
if isprime(k):
r = n-m
m -= 1
return r
KEYWORD
sign,base
AUTHOR
Chai Wah Wu, Feb 23 2021
STATUS
approved