%I #11 Aug 20 2014 12:32:22
%S 2,5,7,11,17,41,47,71,107,167,179,197,449,859,1019,1061,1499,2089,
%T 16901,47717,56269,86269,11917049
%N Primes without "3" as a digit that remain prime when any single digit is replaced with "3".
%C No more terms < 10^13.
%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_591.htm">Puzzle 591</a>
%t 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
%t 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 *)
%Y Cf. A224319, A224321-A224322. Subsequence of A038611.
%K base,more,nonn
%O 1,1
%A _Arkadiusz Wesolowski_, Apr 03 2013
|