Ulam spiral

This is an old revision of this page, as edited by XJaM (talk | contribs) at 05:49, 23 August 2002 (tidying (need some work on some semi vandalism of the original works...). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Ulam spiral, or prime spiral (in other languages called Ulam cloth) is a simple method of graphing the prime numbers that reveals a pattern which has never been fully explained. It was discovered by the mathematician Stanislaw Marcin Ulam in 1963, while doodling on scratch paper at a scientific meeting. Ulam, bored that day, wrote down a regular grid of numbers, starting with 1 at the center, and spiraling anti-clockwise out like this:

    17--16--15--14--13
     |               |
    18  05--04--03  12
     |   |       |   |
    19  06  01--02  11
     |   |           |
    20  07--08--09--10
     |
    21--22--23--24--25...

He then circled all of the prime numbers. To his surprise, the circled numbers tended to line up along diagonal lines. The following two images illustrate this. The first image is a 150×150 Ulam spiral, where primes are black. The diagonal lines are clearly visible. The second pattern is random, where cell n is black with probability 1/log(n), so the black dots have the same density as the Ulam spiral. The lack of diagonal lines in this picture shows that the lines in the Ulam spiral are more than an optical illusion.

File:Ulam primes.png File:Ulam random.png

It appears that there are diagonal lines no matter how many numbers are plotted. This seems to remain true, even if the starting number at the center is much larger than 1. This implies that there are many integer constants b and c such that the function:

f(n) = 4 n2 + b n + c

generates an unexpectedly-large number of primes as n counts up {1, 2, 3, ...}. This was so surprising, that the Ulam spiral appeared on the cover of Scientific American in March 1964. The reasons for this pattern are still not understood.

If we connect all the points, representing primes when n runs to infinity, we might get a two-dimensional fractal in a square.


References