← Iris

Scroll to zoom in/out. Click & drag to pan. Hover over a point to see its number and properties. Touch supported on mobile.
Count10000
Dot Size2.0
Ulam Spiral
Statistics
Numbers Plotted0
Highlighted0
Highlight Ratio0%
Spiral TypeUlam

Why Primes Form Patterns on Spirals

The Ulam Spiral

In 1963, mathematician Stanislaw Ulam was doodling during a boring talk when he arranged integers in a spiral and circled the primes. To his surprise, the primes fell along diagonal lines far more than chance would predict. These diagonals correspond to quadratic polynomials of the form f(n) = 4n² + bn + c, some of which produce an unusually high density of primes. The most famous is Euler's polynomial n² + n + 41, which gives primes for n = 0 through 39.

Sacks and Vogel Spirals

Robert Sacks' Archimedean spiral places each integer n at angle √n · 2π and radius √n, creating smooth curves where the Ulam spiral has sharp corners. The Vogel spiral uses the golden angle (~137.508°) between successive points, the same arrangement nature uses in sunflower seeds and pinecones. Both reveal the same diagonal prime clustering from a different geometric perspective.

The Hardy-Littlewood Conjecture

The diagonal clustering is not an optical illusion. The Hardy-Littlewood conjecture (Conjecture F) predicts that certain quadratic polynomials produce primes with higher- than-average density, determined by the polynomial's discriminant and which primes divide its coefficients. This conjecture remains unproven but is supported by overwhelming numerical evidence — which you can see in this visualization.

Twin Primes and Other Patterns

Twin primes (pairs like 11 & 13, 17 & 19) form their own striking patterns on spirals, appearing in parallel lines next to the prime diagonals. Perfect squares form smooth parabolic curves, and Fibonacci numbers create a distinctive sparse pattern. Each highlighting mode reveals different structural properties of the integers, from the multiplicative (primes) to the additive (Fibonacci).