login
A375548
a(n) is the least prime number of the form n mod (10^k) for some k > 0, or 0 if no such prime number exists.
0
0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 2, 3, 0, 5, 0, 7, 0, 19, 0, 0, 2, 3, 0, 5, 0, 7, 0, 29, 0, 31, 2, 3, 0, 5, 0, 7, 0, 0, 0, 41, 2, 3, 0, 5, 0, 7, 0, 0, 0, 0, 2, 3, 0, 5, 0, 7, 0, 59, 0, 61, 2, 3, 0, 5, 0, 7, 0, 0, 0, 71, 2, 3, 0, 5, 0, 7, 0, 79, 0
OFFSET
0,3
MAPLE
mycat := (n, k) -> parse(cat(convert(n, string), convert(k, string))):
b10digs := n -> max(1, 1 + ilog10(n)): b10cat := (a, b) -> b + a * b10digs(b):
b10parts := p -> local j; [seq(irem(p, 10^(j+1)), j = 0..b10digs(p)-1)]:
b10primes := p -> local j; select(isprime, b10parts(p)):
b10maxprime := proc(n) max(b10primes(n)); ifelse(% = -infinity, 0, %) end: # A331097
b10minprime := proc(n) min(b10primes(n)); ifelse(% = infinity, 0, %) end:
seq(b10minprime(n), n = 0..80);
CROSSREFS
Cf. A331097 (largest prime suffix).
Sequence in context: A331044 A377777 A093438 * A211396 A331097 A047814
KEYWORD
nonn,base
AUTHOR
Peter Luschny, Sep 20 2024
STATUS
approved