In our daily lives, there are two things that we can tell: random event, and those due to cause and effect. However some supposedly random things are simply organized in such a way that we can't help by recognising a cause to their non-coincidental effect.
We see it in nature (the Golden Ratio), and constructs by humans (the movement of share prices). But what about in pure numbers? Especially the most mysterious kind: prime numbers. |
"I would teach the world how the Greeks proved, more than 2,000 years ago, that there are infinitely many prime numbers. In my mind, this discovery is the beginning of mathematics – when humankind realised that, by pure thought alone, it could prove eternal truths of the universe."
Marcus du Sautoy, "Life lessons" The Guardian (April 7, 2005)
This is a meditation upon a figure that began as a doodle made by the mathematician Stanislaw Ulam at a conference in 1964 during another mathematician's talk. Stanislaw Ulam (1909-1984) was an eminent Polish-American mathematician who spent most of his career at Los Alamos, but who also had connections with several American universities, especially the University of Colorado. His many illustrious colleagues included von Neumann, Teller, Metropolis, Erdos, Richtmyer, Rota, and Kac. Ulam had a wide range of mathematical interests. He was deeply involved in the early development of computers at Los Alamos. He is one of the primary developers of the Monte Carlo method, which are now widely used in the fields of statistics, physics, economics, and even finance.
As the story goes, Ulam was bored during a seminar in 1963 and began to doodle in his notebook. In this doodle, Ulam drew the positive integers on a square spiral of the number line, with 0 (or 1, it doesn't much matter) at the center. Then he marked the primes on this folded up number line and immediately noticed that under this unusual transformation many primes tend to fall on diagonal line fragments as well as some horizontal and vertical fragments. |
This seemed a bit surprising since the primes are known to have no predictive structure. Upon returning home, Ulam explored his curious doodle a bit further using one of the very first powerful computers, which happened to be available to him because he was a major player at Los Alamos labs in New Mexico. This computer was called Maniac II, and with it he produced some of the very first purely mathematical computer graphics. Ulam wrote a short paper titled "A Visual Display of Some Properties of the Distribution of Primes" with M. L. Stein and M. B. Wells in 1964 and used the Maniac images to illustrate it.
Ulam's paper associated the diagonal dust with the known fact that many simple quadratic functions produce primes for some range of inputs. The right sidebar explains this in more detail. The quadratic prime generators are fragmentary in their output and in no way represent a general nth prime algorithm. The pattern in Ulam's spiral can be seen as a visualization of these quadratic fragments. But why would quadratics have a tendency to generate prime numbers? |
The primes being a kind of mathematical honey pot, the diagonal dust in his spiral has led to much discussion of the reason for the clearly visible pattern despite the lack of predictability in the primes. Some even assert this figure shows a hidden structure in the primes. Although such assertions are naive, it is nevertheless enlightening to explore why all those diagonal fragments appear by using an even more strongly visual tack than Ulam could manage in the days of Maniac II.
You can begin by asking what simple sets of numbers look like when square spiraled. Here are images of all the multiples of 3, all the multiples of 7, and all odd numbers - meaning the removal of all multiples of 2 - on the square spiral.
You can begin by asking what simple sets of numbers look like when square spiraled. Here are images of all the multiples of 3, all the multiples of 7, and all odd numbers - meaning the removal of all multiples of 2 - on the square spiral.
It turns out that every spiraling of the integer multiples of a single number creates a unique pattern. This usually but not always consists of a repetition of a sort of stamp made up of n values that is repeated but which rotates at diagonal quadrant changes, a clear example of which is seen in the multiples of 7 above. The image on the right is especially worth noting despite it looking like a boring checkerboard. It is a subtractive image of what is left after removing all the multiples of two, that is: it is all the odd numbers on the square spiral. Since all prime numbers except 2 are odd, all the prime numbers except 2 are in the blue squares of that checkerboard.
The diagonal dust in Ulam's prime spiral can be seen as being a result of the sheer density of the primes within the positive integers. One can produce quite similar figures by random selection of points from the remainder structure of the integers at the density of the primes once the multiples of only the first few primes have been removed. The line fragments are the result of the rising density of the primes on the eroding remainder structure rather than any result of their particular values. With each removal cycle of another prime's multiples, the prime density on the remainder structure goes up and this happens fast enough that the diagonal quality of the earliest remainder structure is never completely eroded.
But none of that has anything to do with particular primes, just their density. It is almost thermodynamic in nature and playing out on the odd "crystal" of the square spiraled number line.
There's more beauty than mystery in the diagonal dust in Ulam's spiral. It was a clever doodle indeed that Ulam drew. It's an unusual and scalable visual compression of the number line in a way that can allow patterns, meaningful or not, that would not normally be visible to become so.
Ponder this
Does the Ulam Spiral prove that the appearance of prime numbers are not random?
Can we tell whether the spiral is merely a coincidence or an actual pattern? What are the implications if they are indeed discernible patterns?
Discuss
Stanislaw Ulam originally drew the spiral using a four-point spiral, what if we were to build one based on five- or six-point spirals? Will we get a pattern as well? Does it actually prove a pattern exists or our ability to see patterns everywhere (even when there is none)?
Further readings
Ulam spiral, for a more detailed description on the phenomenon.
"A Visual Display of Some Properties of the Distribution of Primes", the paper co-authored by Ulam as a result of his 'doodle'.
Ulam spiral at Alperton, an interactive Javascript application that displays the prime numbers up to 10^18.
Pareidolia, a psychological phenomenon in which the mind perceives a familiar pattern where none exists. This is a possible explanation.