login
Numbers n such that the string 2357n is the decimal expansion of a prime number.
2

%I #18 Sep 08 2022 08:45:17

%S 23,47,51,83,87,89,93,119,153,167,183,189,219,231,249,263,279,287,297,

%T 321,347,351,353,357,363,371,417,419,423,437,483,507,527,533,549,573,

%U 587,591,617,629,639,657,683,689,701,717,731,737,741,743,749,791,801

%N Numbers n such that the string 2357n is the decimal expansion of a prime number.

%H Robert Israel, <a href="/A103629/b103629.txt">Table of n, a(n) for n = 1..10000</a>

%e 23 is in the sequence because 235723 is prime.

%e 89 is in the sequence because 235789 is prime.

%e 167 is in the sequence because 2357167 is prime.

%p F:= proc(d) op(select(t -> isprime(2357*10^d+t),[seq(t,t=10^(d-1)+1..10^d-1,2)])) end proc:

%p F(2),F(3); # _Robert Israel_, Jul 15 2018

%t Select[Range[1000],PrimeQ[FromDigits[Join[{2,3,5,7},IntegerDigits[ #]]]]&] (* _Harvey P. Dale_, May 29 2014 *)

%o (Magma) [ n: n in [1..900] | IsPrime(Seqint(Intseq(n) cat [7, 5, 3, 2])) ];

%o (PARI) select(n->isprime(23570*10^logint(n, 10) + n), [1..1000]) \\ _Andrew Howroyd_, Jul 15 2018

%K base,nonn

%O 1,1

%A _Parthasarathy Nambi_, Mar 25 2005

%E More terms from _Vincenzo Librandi_, Feb 01 2011