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.
ConstructionUnderstanding how the spiral goes from seemingly random pixels to forming clear lines can be shown through an interactive example
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
These images show the spiral generated for different orders of magnitude (click for a to scale image). They were generated and resized using python.
Resources