Experimenting with the Ulam Spiral

​
number of integers
100
start from
0
show odd divisor sigma
show triangular numbers
show pentagonal numbers
show primes
show grid
The Ulam spiral is named after Stanislaw Ulam, who discovered it by chance in 1963 while doodling on scratch paper at a scientific meeting.
Integers are placed on a square spiral. By marking the prime numbers, you can see that they tend to form patterns lining up in diagonal, horizontal, and vertical lines. This phenomenon can be best observed by drawing a large number of primes.
When starting the spiral with 41, a long diagonal line is clearly visible.
Triangular numbers (of the form
1
2
n(n+1)
) as well as pentagonal numbers (of the form
1
2
n(3n-1)
) give rise to pinwheel patterns on the spiral.
The divisor function
σ
k
(n)
is the sum of the
th
k
powers of the divisors of
n
. By marking out the numbers
n
for which
σ
k
(n)
is odd, you can also see a pinwheel pattern for
k>0
.
Some things to try
• Play "number of integers" and/or "start from" to see how spiral patterns evolve.
• Set "number of integers" to its maximum and observe the pattern, a very regular, pleasant, spiral shape.
• Slide "start from" to its maximum. Notice the pattern disappears. It looks just like random noise.
• Play "number of integers" and/or "start from" to watch spiral patterns evolve.
​

Details

See also:
Triangle Numbers on Ulam Spiral by Adrian Leatherland http://yoyo.cc.monash.edu.au/~bunyip/primes/triangleUlam.htm
Ulam Spiral Images by Matthew M. Conroy at http://www.madandmoonly.com/doctormatt/mathematics/ulamSpirals/ulamSpirals.htm
Ulam spiral at http://en.wikipedia.org/wiki/Ulam_spiral

External Links

Prime (Wolfram MathWorld)
Triangular Number (Wolfram MathWorld)
Pentagonal Number (Wolfram MathWorld)
Divisor Function (Wolfram MathWorld)
Discrete Spiral
Prime Spiral (Wolfram MathWorld)
The Ulam Prime Spiral

Permanent Citation

Giovanna Roda
​
​"Experimenting with the Ulam Spiral"​
​http://demonstrations.wolfram.com/ExperimentingWithTheUlamSpiral/​
​Wolfram Demonstrations Project​
​Published: October 7, 2010