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 A381511 #20 Mar 09 2025 12:24:06 %S A381511 139,3089,5749,20809,60539,110359,173359,618719,1294849,838249, %T A381511 6877109,1895359,11188759,7621259,35560009,33803689,124956059, %U A381511 92801029,142414669,378043979,229316459,390932389,1095750599,995151679,2174082649,2603726969,3402493709,1997191249 %N A381511 Smaller of two consecutive primes p and q, both ending with 9, such that q - p = 10*n, or -1 if no such primes exist. %e A381511 a(1) = 139, because 139 and 139 + 10 = 149 are two consecutive primes with the same last digit 9 and no smaller p has this property. %o A381511 (PARI) a(n) = my(p=9); while (!isprime(p) || ((nextprime(p+1)-p) != 10*n), p+=10); p; \\ _Michel Marcus_, Feb 25 2025 %o A381511 (Python) %o A381511 from sympy import isprime, nextprime %o A381511 def A381511(n): %o A381511 p = 19 %o A381511 while (q:=nextprime(p)): %o A381511 if q-p == 10*n: %o A381511 return p %o A381511 p = q+9-(q%10) %o A381511 while not isprime(p): %o A381511 p += 10 # _Chai Wah Wu_, Mar 08 2025 %Y A381511 Cf. A101232, A140791, A380785, A381372. A381510. %K A381511 nonn,base %O A381511 1,1 %A A381511 _Jean-Marc Rebert_, Feb 25 2025