Brendan Moriarty

Introduction: What is Ulam's Spiral?

Drawing the spiral

(Click to start)

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.

OriginThe 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.

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.

PurposeThe 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.

ConstructionDrawing the spiral

Understanding how the spiral goes from seemingly random pixels to forming clear lines can be shown through an interactive example

(Click to start)

This shows the spiral being generated in real time. Each pixel represents a prime and dark space a non-prime.

Explore the Spiral yourself interactively Resources