Primorial Prime

Author

Eric W. Weisstein
April 10, 2024

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PrimeNumbers/PrimorialPrime.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/PrimorialPrime.html.

©2024 Wolfram Research, Inc. except for portions noted otherwise

Code

This definition defined primorial as indexed by n, the largest prime (Subscript[p, n]) in the product

(*
Primorial[1]:=2
Primorial[n_]:=Primorial[n]=Primorial[n-1]Prime[n]
*)
Primorial[n_]:=Times@@Prime[Range[n]]

p #-1 is prime

Select[Range[100],PrimeQ[Primorial[#]-1]&]

A006794

3# - 1, 5# - 1, ... is prime

primesp={3,5,11,13,41,89,317,337,991,1873,2053,2377,4093,4297,4583,6569,13033,15877,843301,1098133,3267113};

(Subscript[p, 2])# - 1, (Subscript[p, 3])# - 1, ... is prime

A057704

primesn=PrimePi[primesp]

Prime[primesn]==primesp

TextGrid[Transpose[{Range@Length@primesn,primesp,primesn,IntegerLength[1+Primorial/@primesn]}],Dividers->All,Alignment->Decimal]

Do[
Print[{i,{pn=primesn[[i]],Prime[pn]},IntegerLength[p=Primorial[pn]-1],PrimeQ[p]//Timing}],
{i,Length[primesn]}
]

p #+1 is prime

FoldList[Times,1,Prime[Range[10]]]+1

Position[Rest[FoldList[Times,1,Prime[Range[200]]]]+1,_?PrimeQ]//Flatten

Select[Range[100],PrimeQ[Primorial[#]+1]&]

Prime[Flatten[Position[Rest[FoldList[Times,1,Prime[Range[200]]]]+1,_?PrimeQ]]]

A005234

3# + 1, 5# + 1, ... is prime

primesp={2,3,5,7,11,31,379,1019,1021,2657,3229,4547,4787,11549,13649,18523,23801,24029,42209,145823,366439,392113};

A014545

(Subscript[p, 2])# + 1, (Subscript[p, 3])# + 1, ... is prime

primesn=PrimePi[primesp]

Prime[primesn]==primesp

Do[
Print[{i,{pn=primesn[[i]],Prime[pn]},IntegerLength[p=Primorial[pn]+1],PrimeQ[p]//Timing}],
{i,Length[primesn]}
]