This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A341931 #10 Feb 24 2021 08:22:08 %S A341931 -1,-1,2,3,3,5,-1,3,-1,-1,7,11,-1,13,-1,-1,-1,17,-1,19,-1,-1,19,23,23, %T A341931 13,-1,23,-1,29,-1,31,-1,-1,33,-1,-1,37,-1,-1,-1,41,41,43,-1,-1,3,47, %U A341931 17,-1,-1,47,37,41,-1,27,47,-1,57,59,47,61,-1,-1,-1,-1,-1 %N A341931 a(n) = smallest m > 0 such that the decimal concatenation n||n-1||n-2||...||m is prime, or -1 if no such prime exists. %C A341931 a(n) <= A341701(n). a(82) = 1, are there any other n such that a(n) = 1? %C A341931 Primes p such that a(p) < p: 7, 53, 73, 79, 89, 103, ... %C A341931 n such that a(n) < A341701(n): 7, 10, 22, 46, 48, 53, 55, 73, ... %C A341931 Similar argument as in A341716 shows that if n > 3 and a(n) >= 0, then a(n) is odd, n-a(n) !== 2 (mod 3) and n+a(n) !== 0 (mod 3). %e A341931 a(7) = 3 since 76543 is prime and 765432, 7654321 are not. a(10) = 7 since 10987 is prime. %o A341931 (Python) %o A341931 from sympy import isprime %o A341931 def A341931(n): %o A341931 k, m, r = n, n-1, n if isprime(n) else -1 %o A341931 while m > 0: %o A341931 k = int(str(k)+str(m)) %o A341931 if isprime(k): %o A341931 r = m %o A341931 m -= 1 %o A341931 return r %Y A341931 Cf. A052088, A052089, A341701, A341702, A341715, A341716, A341717, A341932. %K A341931 sign,base %O A341931 0,3 %A A341931 _Chai Wah Wu_, Feb 23 2021