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.

A360781 Primes p such that at least one number remains prime when p is bracketed by a single digit d; that is, at least one instance of d//p//d is prime where // means concatenation.

Original entry on oeis.org

2, 3, 5, 7, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 101, 103, 107, 109, 113, 131, 139, 149, 151, 157, 163, 173, 179, 191, 193, 197, 211, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331
Offset: 1

Views

Author

Harvey P. Dale, Feb 20 2023

Keywords

Comments

The bracketing digit d must be 1, 3, 7, or 9.

Examples

			263 is included because 263 is a prime and 32633 (and also 92639) is a prime.
		

Crossrefs

Programs

  • Maple
    q:= p-> ormap(isprime, map(d-> parse(cat(d, p, d)), [1, 3, 7, 9])):
    select(q, [ithprime(i)$i=1..67])[];  # Alois P. Heinz, Feb 22 2023
  • Mathematica
    brkQ[p_]:=AnyTrue[Table[FromDigits[Join[{d},IntegerDigits[p],{d}]],{d,{1,3,7,9}}],PrimeQ]; Select[Prime[Range[100]],brkQ]
  • PARI
    is(p) = my(d=digits(p)); forstep(k=1, 9, 2, if (isprime(fromdigits(concat(k, concat(d,k)))), return(1)));
    isok(p) = if (isprime(p), is(p)); \\ Michel Marcus, Feb 20 2023
  • Python
    from sympy import isprime, nextprime
    from itertools import islice
    def agen(): # generator of terms
        p = 2
        while True:
            sp = str(p)
            if any(isprime(int(d+sp+d)) for d in "1379"):
                yield p
            p = nextprime(p)
    print(list(islice(agen(), 57))) # Michael S. Branicky, Feb 20 2023
    

Formula

Union of A069687, A069688, A069689, A069690. - Alois P. Heinz, Feb 22 2023