Prime Number Explorer

Visualize the building blocks of arithmetic

Sieve of Eratosthenes

Watch the ancient algorithm discover primes by eliminating multiples.


Primes found0
Composites marked0
Current factor--
Pi(n)0
Prime Composite Current factor Being eliminated

Prime Factorization

Decompose any integer into its prime factors.


Enter a number and click Factorize.

Primality Test

Test whether a number is prime using trial division. Shows divisibility details.


Enter a number and click Test.

Twin Prime Finder

Twin primes are pairs (p, p+2) where both are prime. Find all twin primes up to a limit.


Twin pairs found0
Largest pair--

Ulam Spiral

Arrange natural numbers in a spiral and highlight the primes. Discovered by Stanislaw Ulam in 1963, the surprising diagonal patterns remain unexplained.


Numbers0
Primes0
Density0%

Prime Counting Function π(n)

The prime counting function π(n) gives the number of primes less than or equal to n. Compare with the approximation n/ln(n) from the Prime Number Theorem.


π(n) exact n / ln(n) Li(n) (log integral)