Ulam spiral

The Ulam spiral or prime spiral is a graphical depiction of the set of prime numbers, devised by mathematician Stanisław Ulam in 1963 and popularized in Martin Gardner's Mathematical Games column in Scientific American a short time later.

[1] It is constructed by writing the positive integers in a square spiral and specially marking the prime numbers.

Ulam and Gardner emphasized the striking appearance in the spiral of prominent diagonal, horizontal, and vertical lines containing large numbers of primes.

In 1932, 31 years prior to Ulam's discovery, the herpetologist Laurence Klauber constructed a triangular, non-spiral array containing vertical and diagonal lines exhibiting a similar concentration of prime numbers.

In the 201×201 Ulam spiral shown above, diagonal lines are clearly visible, confirming the pattern to that point.

Horizontal and vertical lines with a high density of primes, while less prominent, are also evident.

[5] According to Gardner, Ulam discovered the spiral in 1963 while doodling during the presentation of "a long and very boring paper" at a scientific meeting.

Shortly afterwards, Ulam, with collaborators Myron Stein and Mark Wells, used MANIAC II at Los Alamos Scientific Laboratory to extend the calculation to about 100,000 points.

Images of the spiral up to 65,000 points were displayed on "a scope attached to the machine" and then photographed.

[6] The Ulam spiral was described in Martin Gardner's March 1964 Mathematical Games column in Scientific American and featured on the front cover of that issue.

In an addendum to the Scientific American column, Gardner mentioned the earlier paper of Klauber.

[7][8] Klauber describes his construction as follows, "The integers are arranged in triangular order with 1 at the apex, the second line containing numbers 2 to 4, the third 5 to 9, and so forth.

"[4] Diagonal, horizontal, and vertical lines in the number spiral correspond to polynomials of the form where b and c are integer constants.

To gain insight into why some of the remaining odd diagonals may have a higher concentration of primes than others, consider

At the very least, this observation gives little reason to believe that the corresponding diagonals will be equally dense with primes.

This conjecture, which Hardy and Littlewood called "Conjecture F", is a special case of the Bateman–Horn conjecture and asserts an asymptotic formula for the number of primes of the form ax2 + bx + c. Rays emanating from the central region of the Ulam spiral making angles of 45° with the horizontal and vertical correspond to numbers of the form 4x2 + bx + c with b even; horizontal and vertical rays correspond to numbers of the same form with b odd.

This statement is a special case of an earlier conjecture of Bunyakovsky and remains open.

An unusually rich polynomial is 4x2 − 2x + 41 which forms a visible line in the Ulam spiral.

equals 1, 2, or 0 depending on whether the discriminant is 0, a non-zero square, or a non-square modulo p. This is accounted for by the use of the Legendre symbol,

As in the Ulam spiral, quadratic polynomials generate numbers that lie in straight lines.

This curve asymptotically approaches a horizontal line in the left half of the figure.

(In the Ulam spiral, Euler's polynomial forms two diagonal lines, one in the top half of the figure, corresponding to even values of x in the sequence, the other in the bottom half of the figure corresponding to odd values of x in the sequence.)

Ulam spiral of size 201×201. Black dots represent prime numbers. Diagonal, vertical, and horizontal lines with a high density of prime numbers are clearly visible.
For comparison, a spiral with random odd numbers colored black (at the same density of primes in a 200x200 spiral).
The primes of the form 4 x 2 − 2 x + 41 with x = 0, 1, 2, ... have been highlighted in purple. The prominent parallel line in the lower half of the figure corresponds to 4 x 2 + 2 x + 41 or, equivalently, to negative values of x .