A378081 Primes that remain prime if any two of their digits are deleted.
223, 227, 233, 257, 277, 337, 353, 373, 523, 557, 577, 727, 733, 757, 773, 1117, 1171, 4111
Offset: 1
Examples
From _David A. Corneth_, Nov 18 2024: (Start) 4111 is a term since 4111 is prime and removing any to digits from it gives 11 or 11 or 11 or 41 or 41 or 41 and all of those are prime. No term can end in 12587 as by removing we can (among other numbers) obtain 287, 127, 128, 157, 158, 257 and 587 which are respectively 0 through 6 (mod 7) (all possible residue classes mod 7). So by prepending more digits to 12587 we can always get a multiple of 7 (that is larger than 7) after removing some two digits. (End)
Links
- David A. Corneth, PARI program
Programs
-
Mathematica
q[n_] := Module[{d = IntegerDigits[n], nd}, nd = Length[d]; nd > 2 && AllTrue[FromDigits /@ Map[d[[#]] &, Subsets[Range[nd], {nd - 2}]], PrimeQ]]; Select[Prime[Range[600]], q] (* Amiram Eldar, Nov 16 2024 *)
-
PARI
\\ See Corneth link
-
Python
from sympy import isprime from itertools import combinations as C def ok(n): if n < 100 or not isprime(n): return False s = str(n) return all(isprime(int(t)) for i, j in C(range(len(s)), 2) if (t:=s[:i]+s[i+1:j]+s[j+1:])!="") print([k for k in range(1, 10**6) if ok(k)]) # Michael S. Branicky, Nov 15 2024
Comments