← 🔢 Mathematics

🔢 Prime Gaps

Highlight twin primes
Auto-scan N
Primes ≤ N:
Density π(N)/N:
Largest gap so far:
Twin-prime pairs:
FPS:
Drag — rotate · Scroll — zoom

🔢 Prime Distribution and Gaps

Every integer from 1 up to a chosen limit N is rendered as a cube in a 3D grid or Ulam spiral, with primes lit up in blue while a live histogram on the side tracks the sizes of the gaps between consecutive primes.

🔬 What It Demonstrates

As N grows, primes visibly thin out in line with the Prime Number Theorem, and the gap histogram fills in — showing how small gaps dominate while larger ones become progressively rarer but never disappear.

🎮 How to Use

Drag the Upper limit N slider to scrub through ranges of integers, switch between the wrapped grid and the diagonal-rich Ulam spiral, toggle twin-prime highlighting, or turn on auto-scan to watch the histogram grow on its own.

💡 Did You Know?

Stanisław Ulam discovered his famous spiral in 1963 while doodling during a boring conference talk, noticing primes lining up along diagonals almost by accident.