Prime Visualizations

See the invisible patterns
inside prime numbers.

Three interactive visualizations that reveal the hidden structure of primes — from Ulam's spiral to the chaos of gaps.

🧊
New · 3D

Ulam 3D Visualization

Interactive 3D prime spiral with vertical line detection and slope analysis

Open 3D →

Ulam Spiral

Numbers arranged in a spiral — primes appear as striking diagonal lines. Discovered by Stanisław Ulam in 1963 during a boring meeting.

Size
Prime number
Composite
Center (1)
What you're seeing: Numbers spiral outward from the center. Primes glow — and they cluster along diagonals, revealing hidden arithmetic progressions. The lines are real: they correspond to quadratic polynomials like n²+n+41 that generate many primes.

Numbers
Primes
Density
Largest prime

Prime Gaps

The distance between consecutive primes. Gap +6 always dominates — a structural necessity since 6 = 2×3.

Primes
Key insight: Gap +6 dominates because 2 and 3 are the only consecutive primes — every other pair must skip multiples of both. The gaps grow on average as ln(p), but locally appear chaotic.
Largest gap
Avg gap
Twin primes
+6Dominant gap

Interactive Sieve of Eratosthenes

Step through the ancient algorithm that finds all primes. Click a number or use the controls to eliminate multiples one prime at a time.

Up to
Press Step → to begin. The sieve works by eliminating all multiples of each prime it finds.
Current prime
0Primes found
0Eliminated
Unchecked