Prime Numbers List Calculator

Enter a range to list its primes, or ask for the nth prime.

A whole number, 0 or more.

A whole number up to 1 000 000 000, at most 100 000 above the start.

Try

Result

You entered10≤p≤3010 \le p \le 30

11,  13,  17,  19,  23,  29\displaystyle 11,\; 13,\; 17,\; 19,\; 23,\; 29

How many primes

6\displaystyle 6

Largest prime

29\displaystyle 29
Show the work
  1. Sieve of Eratosthenes

    A prime has no divisor except 1 and itself. The sieve writes down all the numbers in the range, then crosses out every multiple of each prime up to ⌊30⌋=5\lfloor\sqrt{30}\rfloor = 5, since a number with no prime factor up to its square root has none at all. For a window that does not start at 1, only the multiples that land inside the window are crossed out (a segmented sieve).

    primes up to 5:2,  3,  5\begin{gathered} \text{primes up to } 5: \\ 2,\; 3,\; 5 \end{gathered}
  2. Numbers left uncrossed

    Every number from 1010 to 3030 that is not crossed out (and is at least 2) is prime. There are 66.

    11,  13,  17,  19,  23,  2911,\; 13,\; 17,\; 19,\; 23,\; 29
  3. Result

    There are 66 primes from 1010 to 3030.

Worked examples