Wolfram ResearchProductsPurchasingServices & ResourcesAbout UsOur Sites
Mathematica Technical FAQs Services & Resources / Mathematica / Kernels & Programming
-----
 /
Symbols
*Mathematica
*Network Mathematica
*webMathematica
*gridMathematica
*Personal Grid Edition
*Wolfram Workbench
*Wolfram Education Group
*Application Packages
*Mathematica for Students
*Mathematica CalcCenter
*Publicon
*A New Kind of Science Explorer
*Mathematical Explorer
*Mathematica Teacher's Edition
*Calculus WIZ
*Mathematica Player
*Ask about this page
*Print this page
*Email this page
*Give us feedback
*
Sign up for our newsletter:

Prime


Usage Message:

Prime[n] gives the nth prime number.

Attributes[Prime] = {Listable, Protected}


Notes:

The Prime function remembers previous results, so subsequent evaluations will often be faster than the first evaluation.

Prime and PrimePi use sparse caching and sieving for n less than about 10^8. For large n the Lagarias-Miller-Odlyzko algorithm is used for PrimePi , based on asymptotic estimates of the density of primes, and is inverted to give Prime[n].

There is an error in the Prime function in the initial release of Mathematica Version 3.0 for Windows that can cause Prime[n] to crash for sufficiently large values of n. This error has been corrected, and does not affect any other functions, or any versions other than the initial release Mathematica Version 3.0 for Windows. We apologize for any difficulties caused by this error.



Additional Online Documentation:

Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/Prime.html

Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/Prime.html




 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy