Euclid Number

Author

Eric W. Weisstein
December 4, 2003

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

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

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

Code

Primorial[1]:=2
Primorial[n_]:=Primorial[n]=Primorial[n-1]Prime[n]

Eumeration

Block[{$RecursionLimit=1000},
Take[euclid=Primorial/@Range[500]+1,20]
]//Timing

Prime

200

Timing[prime=Flatten[Position[euclid,_?PrimeQ]]]

500

Timing[prime=Flatten[Position[euclid,_?PrimeQ]]]

Take[euclid[[prime]],7]