Ulam's Spiral
Brendan Moriarty
Introduction: What is Ulam's Spiral?

The Ulam Spiral is a visualization of prime numbers that also reveals that the set of numbers generated by certain quadratic equations have a higher frequency of primes when compared to a random set of integers.


The spiral is attributed to the mathemetician Stanislaw Ulam, who, when doodling a number spiral during a "boring" presentation noticed the apparent pattern. By erasing non-primes he noticed that lines appeared to form.

A regular Number Spiral A prime spiral

To further explore this pattern, Ulam visited Los Alamos National Laboratory to use the MANIAC II computer in order to generate the spiral to greater values.


The goal of the interactive examples below is to show how the spiral is constructed, what the spiral looks like for greater values, and to show in real time the spiral being created.