WLJS LogoWLJS Notebook

Prime

Prime[n] gives the nth prime number.

Examples

Get the 10th prime:

Prime[10]
(* 29 *)

First 10 primes:

Table[Prime[n], {n, 1, 10}]
(* {2, 3, 5, 7, 11, 13, 17, 19, 23, 29} *)

The 100th prime:

Prime[100]
(* 541 *)

Please visit the official Wolfram Language Reference for more details.

On this page