%I #20 Sep 08 2022 08:45:46
%S 13331,15551,16661,19991,72227,75557,76667,78887,79997,1177711,
%T 1333313,1355513,1377713,1399913,1711117,1755517,1766617,1777717,
%U 1966619,1977719,2311123,2333323,2922229,2944429,2955529,2977729,3111131
%N Primes whose decimal expansion has the form XYYYX, for nonzero numbers X and Y, where Y is a single digit.
%C There can be no prime whose middle three digits are "000" because it would equal X*(10^Floor[Log[10,X]+1] + 1). - _Robert G. Wilson v_, Jul 11 2009
%H Robert G. Wilson v, <a href="/A162423/b162423.txt">Table of n, a(n) for n = 1..10895</a>
%t f[n_] := Block[{len = Floor[ Log[10, n] + 1]}, Select[10^(3 + len) n + 10^len*Table[k (10^3 - 1)/9, {k, 9}] + n, PrimeQ@# &]]; Array[f, 31] // Flatten (* _Robert G. Wilson v_, Jul 11 2009 *)
%t Select[FromDigits/@Flatten[Table[Join[IntegerDigits[x],PadRight[{},3,y],IntegerDigits[ x]],{x,40},{y,Range[9]}],1],PrimeQ] (* _Harvey P. Dale_, Jun 28 2020 *)
%o (Magma) m:=3; [p: d in [1..9], n in [1..40 by 2] | IsPrime(p) where p is n*(10^(m+t)+1)+d*10^t*(10^m-1) div 9 where t is #Intseq(n)]; // _Vincenzo Librandi_, Sep 14 2013
%K nonn,base
%O 1,1
%A _Vincenzo Librandi_, Jul 03 2009
|