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.

Showing 1-1 of 1 results.

A256481 Smallest prime obtained by appending a number with identical digits to n or 0 if no such prime exists.

Original entry on oeis.org

2, 11, 23, 31, 41, 53, 61, 71, 83, 97, 101, 113, 127, 131, 149, 151, 163, 173, 181, 191, 2011, 211, 223, 233, 241, 251, 263, 271, 281, 293, 307, 311, 3299, 331, 347, 353, 367, 373, 383, 397, 401, 419, 421, 431, 443, 457, 461, 479, 487, 491, 503, 511111, 521, 5333
Offset: 0

Views

Author

Chai Wah Wu, Mar 31 2015

Keywords

Comments

For n <= 15392, a(n) = 0 if and only if n = 6930. Conjecture: if a(n) = 0, then n is divisible by 3. Conjecture verified for n <= 10^6. a(n) = 0 for n = 6930, 50358, 56574, 72975.

Crossrefs

Programs

  • Python
    from gmpy2 import mpz, digits, is_prime
    def A256481(n,limit=2000):
        if n in (6930,50358,56574,72975):
            return 0
        if n == 0:
            return 2
        sn = str(n)
        for i in range(1,limit+1):
            for j in range(1,10,2):
                si = digits(j,10)*i
                p = mpz(sn+si)
                if is_prime(p):
                    return int(p)
        else:
            return 'search limit reached.'
Showing 1-1 of 1 results.