### Spiralling Primes

The Sacks Spiral.

The prime numbers have presented mathematicians with some of their most challenging problems. They continue to play a central role in number theory, and many key questions remain unsolved.

Order and Chaos

The primes have many intriguing properties. In his article “The first 50 million prime numbers”, Don Zagier noted two contradictory characteristics of the distribution of prime numbers. The first is the erratic and seemingly chaotic way in which the primes “grow like weeds among the natural numbers”. The second is that, when they are viewed in the large, they exhibit “stunning regularity”.

Many people have sought patterns in the prime numbers, and there has been much progress. But we still do not hold a key that unlocks all their secrets.

Ulam’s Spiral

In 1963, Stanslaw Ulam arranged the natural numbers in a spiral pattern, and discovered that many of the prime numbers occurred along particular diagonal lines. Ulam’s spiral pattern was popularized by Martin Gardner in his Mathematical Games column in Scientific American. According to Gardner, Ulam discovered the pattern while attending a boring lecture during a scientific meeting. The figure below shows the method of construction devised by Ulam (left) and a spiral of size ${200\times200}$ with prime numbers marked. Several diagonal lines with a high density of primes are clearly visible.

Left: Construction of the Ulam spiral. Right: Ulam spiral of size ${200\times200}$ [image Wikimedia Commons].

A simple quadratic polynomial was found by Euler that takes an unusually large number of prime values for integer arguments. It is

$\displaystyle f(n) = n^2 - n + 41$

which is prime for all whole numbers from ${1}$ to ${40}$. These primes show up in the Ulam spiral, but they are split into two diagonals on opposite sides of the origin.

Improving on Ulam’s Spiral

A clever variation on Ulam’s spiral was found in 1994 by software engineer Robert Sacks. He plotted the natural numbers on an Archimedean spiral, with the following equations in polar coordinates:

$\displaystyle r = \sqrt{n} \,, \qquad \theta = 2\pi\sqrt{n} \,.$

Thus, ${r \propto \theta}$ which yields a spiral with radial distance increasing by a fixed amount for each circuit of the origin. And the square roots ensure that the azimuthal angle ${\theta}$ is an exact multiple of ${2\pi}$ for all square numbers ${n = k^2}$.

The pattern for the first 100 numbers is shown below (left panel). The underlying Archimedean spiral is also shown. Perfect squares, coloured red, occur on the positive ${x}$-axis. The numbers coloured magenta are pronic numbers, that is, numbers of the form ${n=k(k+1)}$. These are also arrranged in a quasi(?)-linear pattern.

The Sacks spiral for ${n\le 100}$. Left: square numbers are red and pronic numbers magenta. Right: prime numbers are in blue.

The right-hand panel shows the same spiral, but with the prime numbers coloured blue. The pattern is not immediately obvious, but it is clear that the primes are not arranged in random order: there is evidence of some definite structure.

The following figure shows primes from 2 to 50,000 marked in blue. We see a number of curved lines along which many primes are arranged. The spiral in red is for prime numbers of the form ${n^2-n+41}$, Euler’s polynomial. We can see how densely primes occur on this curve.

The Sacks spiral for ${n\le 50,000}$. Prime numbers are in blue.

Composite Numbers

The interest of Sacks’s spiral is not confined to prime numbers. It also reveals patterns amongst the composite numbers. The ${\Omega}$-function is a measure of the extent to which a number is composite: ${\Omega(n)}$ is the number of prime factors of ${n}$, with multiplicities counted. Obviously, ${\Omega(p)=1}$ for each prime number. Also, for the ${k}$-th power of a prime we have ${\Omega(p^k)=k}$. For another example, ${120 = 2\times2\times2\times3\times5}$ so that ${\Omega(120)=5}$.

The figure below shows the spiral for ${n\le 15,000}$ with the dot-size (and colour) of point ${n}$ scaled in proportion to ${\Omega(n)}$. It shows a wealth of structures, with families of curves corresponding to sets of numbers with the same degree of compositeness.

The Sacks spiral ${n\le 15,000}$ with points scaled in proportion to ${\Omega(n)}$.

There is much more that can be said about the Sacks spiral. Additional information and explanations can be found on the web-site of the inventor, Robert Sacks (URL below).

Sources

${\bullet}$ Robert Sacks’s website on the number spiral .

${\bullet}$ Wikipedia article Ulam Spiral  .

${\bullet}$ Zagier, Don, 1977: The first 50 million prime numbers. The Mathematical Intelligencer, 1, 7–19.