login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A050249 Weakly prime numbers (changing any one decimal digit always produces a composite number). Also called digitally delicate primes. 20

%I #99 Mar 25 2023 03:12:18

%S 294001,505447,584141,604171,971767,1062599,1282529,1524181,2017963,

%T 2474431,2690201,3085553,3326489,4393139,5152507,5564453,5575259,

%U 6173731,6191371,6236179,6463267,6712591,7204777,7469789,7469797

%N Weakly prime numbers (changing any one decimal digit always produces a composite number). Also called digitally delicate primes.

%C Tao proved that this sequence is infinite. - _T. D. Noe_, Mar 01 2011

%C For k = 5, 6, 7, 8, 9, 10, the number of terms < 10^k in this sequence is 0, 5, 35, 334, 3167, 32323. - _Jean-Marc Rebert_, Nov 10 2015

%D 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

%H Jon E. Schoenfield, <a href="/A050249/b050249.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1317 from Klaus Brockhaus, terms 1318..3167 from Jean-Marc Rebert).

%H Michael Filaseta and Jacob Juillerat, <a href="https://arxiv.org/abs/2101.08898">Consecutive primes which are widely digitally delicate</a>, arXiv:2101.08898 [math.NT], 2021.

%H Jon Grantham, <a href="https://arxiv.org/abs/2109.03923">Finding a Widely Digitally Delicate Prime</a>, arXiv:2109.03923 [math.NT], 2021.

%H Ernest G. Hibbs, <a href="https://www.proquest.com/openview/4012f0286b785cd732c78eb0fc6fce80">Component Interactions of the Prime Numbers</a>, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.

%H Jackson Hopper and Paul Pollack, <a href="http://arxiv.org/abs/1510.03401">Digitally delicate primes</a>, arXiv:1510.03401 [math.NT], 2015.

%H Dana Jacobsen, <a href="https://ntheory.org/data/delicate_1e11.txt">Digitally delicate primes up to 1e11</a>

%H Jeremiah T. Southwick, <a href="https://scholarcommons.sc.edu/etd/5879/">Two Inquiries Related to the Digits of Prime Numbers</a>, Ph. D. Dissertation, University of South Carolina (2020).

%H Terence Tao, <a href="http://arxiv.org/abs/0802.3361">A remark on primality testing and decimal expansions</a>, arXiv:0802.3361 [math.NT], 2008-2010; Journal of the Australian Mathematical Society 91:3 (2011), pp. 405-413.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/WeaklyPrime.html">Weakly Prime</a>

%t 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 *)

%o (Magma) IsA118118:=function(n); D:=Intseq(n); return forall{ <k, j>: 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

%o (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);}

%o lista(nn) = {forprime(p=2, nn, if (isokp(p), print1(p, ", ")););} \\ _Michel Marcus_, Dec 15 2015

%o (Python)

%o from sympy import isprime

%o def h1(n): # hamming distance 1 neighbors of n

%o s = str(n); d = "0123456789"; L = len(s)

%o yield from (int(s[:i]+c+s[i+1:]) for c in d for i in range(L) if c!=s[i])

%o def ok(n): return isprime(n) and all(not isprime(k) for k in h1(n) if k!=n)

%o print([k for k in range(10**6) if ok(k)]) # _Michael S. Branicky_, Jun 19 2022

%Y Cf. A118118, A158124 (weakly primes), A158125 (weakly primes).

%Y Cf. A137985 (analogous base-2 sequence), A186995 (weak primes in base n).

%K nonn,base

%O 1,1

%A _Eric W. Weisstein_

%E Edited by _Charles R Greathouse IV_, Aug 02 2010

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:38 EDT 2024. Contains 371967 sequences. (Running on oeis4.)