login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo

Thanks to everyone who made a donation during our annual appeal!
To see the list of donors, or make a donation, see the OEIS Foundation home page.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A158124 Weakly prime numbers (or isolated primes): changing any one decimal digit always produces a composite number, with restriction that first digit may not be changed to a 0. 7
294001, 505447, 584141, 604171, 929573, 971767, 1062599, 1282529, 1524181, 2017963, 2474431, 2690201, 3070663, 3085553, 3326489, 4393139, 5152507, 5285767, 5564453, 5575259, 5974249, 6173731, 6191371, 6236179, 6463267 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

The definition could be restated as "primes p with d digits such that there is no prime q with at most d digits at Hamming distance 1 from p (in base 10)". - N. J. A. Sloane, May 06 2019

For the following values of k, 5, 6, 7, 8, 9, 10, the number of terms < 10^k in this sequence is 0, 6, 43, 406, 3756, 37300. - Jean-Marc Rebert, Nov 10 2015

LINKS

Jean-Marc Rebert, Table of n, a(n) for n = 1..3756

C. Rivera, Weakly Primes

Eric Weisstein's World of Mathematics, Weakly Prime

MAPLE

filter:= proc(n)

  local L, i, d, ds;

  if not isprime(n) then return false fi;

  L:= convert(n, base, 10);

  for i from 1 to nops(L) do

    if i = nops(L) then ds:= {$1..9} minus {L[i]}

    elif i = 1 then ds:= {1, 3, 7, 9} minus {L[i]}

    else ds:= {$0..9} minus {L[i]}

    fi;

    for d in ds do

      if isprime(n + (d - L[i])*10^(i-1)) then return false fi;

    od

  od;

  true

end proc:

select(filter, [seq(i, i=11..10^6, 2)]); # Robert Israel, Dec 15 2015

MATHEMATICA

Select[Prime@ Range[10^5], Function[n, Function[w, Total@ Map[Boole@ PrimeQ@ # &, DeleteCases[#, n]] &@ Union@ Flatten@ Map[Function[d, FromDigits@ ReplacePart[w, d -> #] & /@ If[d == 1, #, Prepend[#, 0]] &@ Range@ 9], Range@ Length@ w] == 0]@ IntegerDigits@ n]] (* Michael De Vlieger, Dec 13 2016 *)

PROG

(PARI) isokp(n) = {v = digits(n); for (k=1, #v, w = v; if (k==1, idep = 1, idep=0); for (j=idep, 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

CROSSREFS

Cf. A050249, A158125 (weakly primes), A186995, A192545.

Sequence in context: A255754 A254843 A318787 * A050249 A224973 A328664

Adjacent sequences:  A158121 A158122 A158123 * A158125 A158126 A158127

KEYWORD

nonn,base

AUTHOR

Eric W. Weisstein, Mar 13 2009

EXTENSIONS

Edited by Charles R Greathouse IV, Aug 02 2010

Missing a(3385) inserted into b-file by Andrew Howroyd, Feb 23 2018

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified January 22 07:30 EST 2020. Contains 331139 sequences. (Running on oeis4.)