A080603 Primes such that deleting some digit yields a prime.
13, 17, 23, 29, 31, 37, 43, 47, 53, 59, 67, 71, 73, 79, 83, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 229, 233, 239, 241, 263, 269, 271, 283, 293, 307, 311, 313, 317, 331, 337, 347, 353, 359, 367
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Q@n_:=AnyTrue[FromDigits@Delete[IntegerDigits@n,#]&/@Range@IntegerLength@n, PrimeQ]; Select[Prime@Range@500, Q@# &] (* Hans Rudolf Widmer, Jun 09 2024 *)
-
Python
from sympy import isprime def ok(n): if n < 10 or not isprime(n): return False s = str(n) si = (s[:i]+s[i+1:] for i in range(len(s))) return any(isprime(int(t)) for t in si) print([k for k in range(368) if ok(k)]) # Michael S. Branicky, Jan 28 2023
Comments