login
Numbers n such that n! - prime(n) is prime.
7

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

%S 4,5,7,12,14,15,16,17,18,20,30,37,39,49,52,66,86,162,165,202,235,250,

%T 366,419,1169,1311,1916,3032,3211,3335,4650,6199,7762

%N Numbers n such that n! - prime(n) is prime.

%C a(34) > 12500. - _Giovanni Resta_, Mar 16 2014

%t Do[ If[ PrimeQ[ n! - Prime[ n ] ], Print[ n ] ], {n, 1, 600} ]

%t Select[Range[2000], PrimeQ[#! - Prime[#]] &] (* _Vincenzo Librandi_, Mar 05 2015 *)

%o (Magma) [n: n in [1..200] | IsPrime(Factorial(n)- NthPrime(n))]; // _Vincenzo Librandi_, Mar 05 2015

%Y Cf. A064278.

%K nonn,more,hard

%O 1,1

%A _Robert G. Wilson v_, Sep 28 2001

%E Three more terms from _Farideh Firoozbakht_, Feb 28 2004

%E a(28)-a(33) from _Giovanni Resta_, Mar 16 2014