A373859 Smallest prime obtained by appending one or more 9's to n, -1 if no such prime exists.
19, 29, -1, 499, 59, -1, 79, 89, -1, 109, 1199999, -1, 139, 149, -1, 1699, 179, -1, 199, 2099, -1, 229, 239, -1, 25999, 269, -1, 289999, 2999, -1, 319999999999999999999999999999, 3299, -1, 349, 359, -1, 379, 389, -1, 409, 419, -1, 439, 449, -1
Offset: 1
Links
- Toshitaka Suzuki, Table of n, a(n) for n = 1..448
Programs
-
Python
from itertools import count from sympy import isprime def A373859(n): return next(p for p in ((n+1)*10**m-1 for m in count(1)) if isprime(p)) if n%3 else -1 # Chai Wah Wu, Jul 08 2024
Formula
a(11) = 1199999 because 119, 1199, 11999 and 119999 are not primes.