Calcoid
Math

Prime Numbers List Calculator

List the first N primes or every prime up to N. Uses the Sieve of Eratosthenes and reports count, sum, smallest, largest, and all twin prime pairs.

Prime list inputs

Whole number from 1 to 10,000,000.

Prime count

25

Sum
1,060
Smallest
2
Largest
97
Twin prime pairs
8

Primes

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Twin primes (p, p+2)

(3, 5), (5, 7), (11, 13), (17, 19), (29, 31), (41, 43), (59, 61), (71, 73)

Frequently Asked Questions about the Prime Numbers List Calculator

What counts as a prime number?
A prime is a whole number greater than 1 whose only positive divisors are 1 and itself. The first ten primes are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. The number 1 is neither prime nor composite by modern convention, which keeps prime factorization unique for every integer greater than 1.
How does the Sieve of Eratosthenes work?
The sieve writes out the integers from 2 to N, then walks through each candidate p in turn. For the first un-crossed value (which must be prime), it crosses out every multiple p, 2p, 3p, and so on, up to N. The next un-crossed value is also prime, and the process repeats. Once p exceeds sqrt(N), every remaining un-crossed number is prime. Total work is roughly N log log N, which is fast enough to list every prime under ten million in well under a second on a phone.
What are twin primes?
Twin primes are pairs of primes that differ by exactly 2, such as (3, 5), (5, 7), (11, 13), (17, 19), (29, 31), and (41, 43). The twin prime conjecture says there are infinitely many such pairs, and it remains unproven despite enormous computational evidence. The largest known twin prime pair as of 2024, 2,996,863,034,895 x 2^1,290,000 +/- 1, has 388,342 digits.
Why are prime gaps larger for bigger numbers?
On average, the gap between consecutive primes near a number n grows like ln(n), so primes thin out the further you look. The prime number theorem makes this precise: the count of primes up to n is approximately n / ln(n). Gaps stay surprisingly varied though, with twin primes appearing arbitrarily far out alongside occasional very long stretches of composite numbers (prime deserts).
What is the largest known prime number?
All recent record holders are Mersenne primes of the form 2^p - 1, where p itself is prime. As of 2024, the largest known prime is M82589933 = 2^82,589,933 - 1, discovered by Patrick Laroche through the Great Internet Mersenne Prime Search (GIMPS). It has 24,862,048 digits, far beyond the range any browser calculator can list directly.