login
Numbers n such that n!/n#-1 and n!/n#+1 is a twin prime pair.
4

%I #15 Apr 03 2023 10:36:11

%S 4,5,8,34,280,281

%N Numbers n such that n!/n#-1 and n!/n#+1 is a twin prime pair.

%C 4,5 and 280,281 result in the same respective twin prime pairs. Using gmp, testing n < 4000, the last 3-prp found was the 8897 digit 3-prp, 3337!/3337#-1.

%H G. L. Honaker, Jr. and Chris Caldwell, <a href="https://t5k.org/curios/cpage/2777.html">Prime Curios! 281</a>

%F n# is the primorial function A034386(n).

%F A140293 INTERSECT A140294. - R. J. Mathar, Feb 27 2012

%e 8!/8#-1 = 191,8!/8#-1 = 193. 191 and 193 form a twin prime pair.

%t Primorial[n_] := Product[Prime[i], {i, 1, PrimePi[n]}];

%t Select[Range[

%t 1000], (p = (#! / Primorial[#]);

%t PrimeQ[p + 1] && PrimeQ[p - 1]) &] (* _Robert Price_, Oct 11 2019 *)

%o (PARI) g(n) = for(x=1,n,y=x!/primorial(x)-1;z=nextprime(y+1); if(ispseudoprime(y)&&z-y==2,print1(x","))) primorial(n) = \ The product of primes <= n using the pari primelimit. { local(p1,x); if(n==0||n==1,return(1)); p1=1; forprime(x=2,n,p1*=x); return(p1) }

%K hard,nonn

%O 4,1

%A _Cino Hilliard_, May 25 2008