cp's OEIS Frontend

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.

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.

Original entry on oeis.org

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

Views

Author

Peter Luschny, Sep 20 2024

Keywords

Crossrefs

Cf. A331097 (largest prime suffix).

Programs

  • 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);