A050249 Weakly prime numbers (changing any one decimal digit always produces a composite number). Also called digitally delicate primes.
294001, 505447, 584141, 604171, 971767, 1062599, 1282529, 1524181, 2017963, 2474431, 2690201, 3085553, 3326489, 4393139, 5152507, 5564453, 5575259, 6173731, 6191371, 6236179, 6463267, 6712591, 7204777, 7469789, 7469797
Offset: 1
References
- Michael Filaseta and Jeremiah Southwick, Primes that become composite after changing an arbitrary digit, Math. Comp. (2021) Vol. 90, 979-993. doi:10.1090/mcom/3593
Links
- Jon E. Schoenfield, Table of n, a(n) for n = 1..10000 (terms 1..1317 from Klaus Brockhaus, terms 1318..3167 from Jean-Marc Rebert).
- Michael Filaseta and Jacob Juillerat, Consecutive primes which are widely digitally delicate, arXiv:2101.08898 [math.NT], 2021.
- Jon Grantham, Finding a Widely Digitally Delicate Prime, arXiv:2109.03923 [math.NT], 2021.
- Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
- Jackson Hopper and Paul Pollack, Digitally delicate primes, arXiv:1510.03401 [math.NT], 2015.
- Dana Jacobsen, Digitally delicate primes up to 1e11
- Matt Parker, How do you prove a prime is infinitely fragile?, Stand-up Maths YouTube video, 2022.
- Jeremiah T. Southwick, Two Inquiries Related to the Digits of Prime Numbers, Ph. D. Dissertation, University of South Carolina (2020).
- Terence Tao, A remark on primality testing and decimal expansions, arXiv:0802.3361 [math.NT], 2008-2010; Journal of the Australian Mathematical Society 91:3 (2011), pp. 405-413.
- Eric Weisstein's World of Mathematics, Weakly Prime
Crossrefs
Programs
-
Magma
IsA118118:=function(n); D:=Intseq(n); return forall{
: k in [1..#D], j in [0..9] | j eq D[k] or not IsPrime(Seqint(S)) where S:=Insert(D, k, k, [j]) }; end function; [ p: p in PrimesUpTo(8000000) | IsA118118(p) ]; // Klaus Brockhaus, Feb 28 2011 -
Mathematica
fQ[n_] := Block[{d = IntegerDigits@ n, t = {}}, Do[AppendTo[t, FromDigits@ ReplacePart[d, i -> #] & /@ DeleteCases[Range[0, 9], x_ /; x == d[[i]]]], {i, Length@ d}]; ! AnyTrue[Flatten@ t, PrimeQ]] ; Select[Prime@ Range[10^5], fQ] (* Michael De Vlieger, Nov 10 2015, Version 10 *)
-
PARI
isokp(n) = {v = digits(n); for (k=1, #v, w = v; for (j=0, 9, if (j != v[k], w[k] = j; ntest = subst(Pol(w), x, 10); if (isprime(ntest), return(0));););); return (1);} lista(nn) = {forprime(p=2, nn, if (isokp(p), print1(p, ", ")););} \\ Michel Marcus, Dec 15 2015
-
Python
from sympy import isprime def h1(n): # hamming distance 1 neighbors of n s = str(n); d = "0123456789"; L = len(s) yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L) if c!=s[i]) def ok(n): return isprime(n) and all(not isprime(k) for k in h1(n) if k!=n) print([k for k in range(10**6) if ok(k)]) # Michael S. Branicky, Jun 19 2022
Extensions
Edited by Charles R Greathouse IV, Aug 02 2010
Comments