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.

A125001 Non-insertable primes: primes with property that no matter where you insert (or prepend or append) a digit you get a composite number (except for prepending a zero).

Original entry on oeis.org

369293, 3823867, 5364431, 5409259, 7904521, 8309369, 9387527, 9510341, 22038829, 27195601, 28653263, 38696543, 39091441, 39113161, 43744697, 45095839, 45937109, 48296921, 48694231, 49085093, 49106677, 50791927
Offset: 1

Views

Author

David W. Wilson, Jan 08 2007

Keywords

Comments

Is the sequence infinite? - Zak Seidov, Nov 14 2014

Examples

			369293 is a member because all of 1369293, 2369293, 3369293, ..., 3069293, 3169293, ..., 3692930, ..., 3692939 are composite.
		

Crossrefs

Programs

  • Mathematica
    nipQ[x_]:=Module[{id=IntegerDigits[x],len},len=Length[id];AllTrue[ Select[ Flatten[Table[FromDigits[Insert[id,n,i]],{i,len+1},{n,0,9}],1],#!=x&], CompositeQ]]; Select[ Prime[Range[3050000]],nipQ] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 12 2018 *)
  • Python
    from sympy import isprime
    from itertools import islice
    def ok(n):
        if not isprime(n): return False
        s = str(n)
        for c in "0123456789":
            for k in range(len(s)+1):
                w = s + c if k == 0 else s[:-k] + c + s[-k:]
                if w[0] != "0" and isprime(int(w)): return False
        return True
    print([k for k in range(10**7) if ok(k)]) # Michael S. Branicky, Sep 29 2022