A224322
Primes without "9" as a digit that remain prime when any single digit is replaced with "9".
Original entry on oeis.org
17, 107, 137, 347, 1013, 1433, 1613, 3767, 4337, 8623, 25633, 31114073
Offset: 1
-
lst = {}; n = 9; Do[If[PrimeQ[p], i = IntegerDigits[p]; If[FreeQ[i, n], t = 0; s = IntegerLength[p]; Do[If[PrimeQ@FromDigits@Insert[Drop[i, {d}], n, d], t++, Break[]], {d, s}]; If[t == s, AppendTo[lst, p]]]], {p, 25633}]; lst
pr9Q[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,9]&&AllTrue[Table[ FromDigits[ ReplacePart[ idn,i->9]],{i,Length[idn]}],PrimeQ]]; Select[ Prime[Range[2*10^6]],pr9Q] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 30 2015 *)
A224320
Primes without "3" as a digit that remain prime when any single digit is replaced with "3".
Original entry on oeis.org
2, 5, 7, 11, 17, 41, 47, 71, 107, 167, 179, 197, 449, 859, 1019, 1061, 1499, 2089, 16901, 47717, 56269, 86269, 11917049
Offset: 1
-
lst = {}; n = 3; Do[If[PrimeQ[p], i = IntegerDigits[p]; If[FreeQ[i, n], t = 0; s = IntegerLength[p]; Do[If[PrimeQ@FromDigits@Insert[Drop[i, {d}], n, d], t++, Break[]], {d, s}]; If[t == s, AppendTo[lst, p]]]], {p, 86269}]; lst
p3Q[n_]:=Module[{idn=IntegerDigits[n]},FreeQ[idn,3] && AllTrue[ FromDigits/@ Table[ReplacePart[idn,i->3],{i,IntegerLength[n]}],PrimeQ]]; Select[Prime[Range[10^6]],p3Q] (* The program uses the function AllTrue from Mathematica version 10 *) (* Harvey P. Dale, Aug 20 2014 *)
A224321
Primes without "7" as a digit that remain prime when any single digit is replaced with "7".
Original entry on oeis.org
2, 3, 5, 11, 13, 19, 31, 41, 43, 61, 109, 139, 251, 643, 4933, 9433, 36493, 191416111, 1304119699
Offset: 1
-
lst = {}; n = 7; Do[If[PrimeQ[p], i = IntegerDigits[p]; If[FreeQ[i, n], t = 0; s = IntegerLength[p]; Do[If[PrimeQ@FromDigits@Insert[Drop[i, {d}], n, d], t++, Break[]], {d, s}]; If[t == s, AppendTo[lst, p]]]], {p, 36493}]; lst
Select[Prime[Range[4000]],DigitCount[#,10,7]==0&&AllTrue[FromDigits/@Table[ReplacePart[ IntegerDigits[#],n->7],{n,IntegerLength[#]}],PrimeQ]&] (* The program generates the first 17 terms of the sequence. *) (* Harvey P. Dale, Jun 09 2024 *)
Showing 1-3 of 3 results.
Comments