You know what mathematicians do when they have some spare time? They doodle with spirals and find curious and interesting patterns of prime numbers. That is what Stanislaw Ulam did back in the 60s, I imagine while sitting through a particularly boring talk at some conference. He wrote down the integers along a rectangular grid and noticed the location of the primes along this spiral. The primes seem to concentrate along certain patterns such as diagonals.
Finding patterns among the primes is among the most important problems of mathematics. Primes occupy a central position in mathematics because they can be viewed as the building blocks of all integers through the unique factorization theorem. There has been some success in characterizing them on a large scale (such as counting the number of primes less than n for some large n) but at a smaller scale things still are murky.
The prime spirals are one among many such tantalizing patterns involving prime numbers that are still not conclusively explained. The same patterns appear with other spirals such as Archimedean and the square root spiral. One such pattern in the Archimedean spiral corresponds to Euler’s prime generating polynomial , a famous prime rich polynomial that generates primes for n=1 to 39. If you want to generate a square spiral, try this in matlab: imshow(double(~isprime(spiral(n)))) generates a
prime spiral. Look here for the Archimedean spiral.
Such patterns show how little we really understand primes and how far we still have to go. As an aside, the prime generating polynomial of Euler is very interesting. However, trying to create a polynomial that generates only primes is a doomed effort. Can you prove that any polynomial will surely produce a composite number for some integer
?