login
A373201
a(n) = smallest number m > 0 such that n followed by m 9's yields a prime, or -1 if no such m exists.
2
1, 1, -1, 2, 1, -1, 1, 1, -1, 1, 5, -1, 1, 1, -1, 2, 1, -1, 1, 2, -1, 1, 1, -1, 3, 1, -1, 4, 2, -1, 28, 2, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 16, 1, -1, 1, 1, -1, 3, 2, -1, 5, 1, -1, 15, 1, -1, 1, 2, -1, 12, 1, -1, 4, 2, -1, 1, 1, -1, 1, 2, -1, 1, 3
OFFSET
1,4
COMMENTS
a(n) = -1 when n = 3*k because no matter how many 9's are appended to n, the resulting number is always divisible by 3 and therefore cannot be prime.
a(n) = -1 when n = 37037*k + 8424, 10175, 10998, 12210, 17600, 19360, 25826, 27146, 27685, 27861, 35915 or 36047, because n followed by any positive number, m say, of 9's is divisible by at least one of the primes {7,11,13,37}.
a(4420) > 300000 or a(4420) = -1.
LINKS
EXAMPLE
a(25)=3 because 259 and 2599 are composite but 25999 is prime.
CROSSREFS
KEYWORD
sign,base
AUTHOR
Toshitaka Suzuki, May 27 2024
STATUS
approved