Prime Numbers List Calculator

List every prime number in a range up to 2,000,000 using the Sieve of Eratosthenes, with the count, sum and largest gap. The Sieve of Eratosthenes writes out 2 … N and crosses out the multiples of each prime p starting at p². Example: with from 1, …, the result is Primes in range = 25.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the Prime Numbers List Calculator?

Enter the start and end of your range (the end can be as large as two million). The calculator runs a sieve, lists the primes in the range and reports how many there are, their sum and the largest gap between consecutive primes.

What formula does the Prime Numbers List Calculator use?

The Sieve of Eratosthenes writes out 2 … N and crosses out the multiples of each prime p starting at p². The numbers left are the primes. The prime counting function π(N) is approximated by N ÷ ln N, which the prime number theorem shows becomes accurate as N grows.

Worked example: From 1, To 100

There are 25 primes up to 100: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97. Their sum is 1060, and the largest gap between neighbours is 8 (between 89 and 97).

With the default values the calculator returns Primes in range = 25; List of 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; Sum of the primes = 1060; Largest gap between consecutive primes = 8.

Where Is This Calculation Used?

Prime lists are used in number-theory courses, in programming exercises and in puzzles about twin primes or prime gaps. Counting primes in a range shows the thinning pattern: 25 below 100, 168 below 1,000 and 1,229 below 10,000.

What are the most common mistakes with the Prime Numbers List Calculator?

  • Including 1 in a list of primes.
  • Forgetting that the lower end of the range is inclusive.
  • Expecting a fixed formula that produces only primes; none is known.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: From1
Input: To100
Primes in range25
List of primes2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
Sum of the primes1060
Largest gap between consecutive primes8
π(100) = primes up to 10025

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

How many prime numbers are there below 100?

There are 25 primes below 100, the largest being 97.

What is the Sieve of Eratosthenes?

An ancient algorithm that finds primes by crossing out multiples of each prime, leaving only the primes.

Are there infinitely many primes?

Yes. Euclid proved around 300 BC that the list of primes never ends.