PRIME NUMBERS

To find every prime below 900 you only need to cross out multiples of the numbers up to 30. The reason is short: any composite n ≤ 900 must have a prime factor ≤ √n ≤ 30, so it has already been struck out — that is the whole trick of the Sieve of Eratosthenes. The survivors thin out at exactly the rate the Prime Number Theorem describes, roughly one prime per ln x numbers around x, yet Euclid proved they never run out. Lay the integers along a square spiral and the primes gather, unbidden, along diagonal lines.

▸ Spreading the numbers 1 … N onto the grid…
▸ Loading the Sieve of Eratosthenes
▸ Building the Ulam spiral from the center
▸ Measuring density & the x∕ln x estimate
▸ Filtering the numbers divisible only by 1 & themselves…
▸ Ready — Online. ✅
0%
⌂ Mathematics

Simulation room Prime numbers

Prime Numbers
Online
divisible only by 1 & itself
Count & density
🔢 Sieve of Eratosthenes
prime density by block
Range (N)—
Primes found—
Density—
Sieving multiples of—
Estimate N∕ln N—
Largest prime—
Tip
Each cell is a natural number. A bright green number = prime (divisible only by 1 & itself); a dim number = composite, crossed off as a multiple of a smaller number. Primes thin out as you go further.
—
Hover a cell = see the number & its divisors · click = factorize · adjust speed & range on the right
Your browser has canvas disabled.
Prime density per block (falls as N grows) actual densityestimate 1∕ln x
About Prime Numbers

To find every prime below 900 you only need to cross out multiples of the numbers up to 30. The reason is short: any composite n ≤ 900 must have a prime factor ≤ √n ≤ 30, so it has already been struck out — that is the whole trick of the Sieve of Eratosthenes. The survivors thin out at exactly the rate the Prime Number Theorem describes, roughly one prime per ln x numbers around x, yet Euclid proved they never run out. Lay the integers along a square spiral and the primes gather, unbidden, along diagonal lines.

Related topics in Mathematics