From Wikipedia, the free encyclopediaThe Ulam spiral, or prime spiral (in other languages also called the Ulam Cloth) is a simple method of visualizing the prime numbers that reveals the apparent tendency of certain quadratic polynomials to generate unusually large numbers of primes. It was discovered by the mathematician Stanislaw Ulam in 1963, while he was doodling during the presentation of a “long and very boring paper” at a scientific meeting. Shortly afterwards, in an early application of computer graphics, Ulam with collaborators Myron Stein and Mark Wells used MANIAC II at Los Alamos Scientific Laboratory to produce pictures of the spiral for numbers up to 65,000. In March of the following year, Martin Gardner wrote about the Ulam spiral in his Mathematical Games column; the Ulam spiral featured on the front cover of the issue of Scientific American in which the column appeared.
Ulam constructed the spiral by writing down a regular rectangular grid of numbers, starting with 1 at the center, and spiraling out:
diagonal lines. The image below is a 200×200 Ulam spiral, where primes are black. Diagonal lines are clearly visible, confirming the pattern. Horizontal and vertical lines, while less prominent, are also evident.
Tests so far confirm that there are diagonal lines even when many numbers are plotted. The pattern also seems to appear even if the number at the center is not 1 (and can, in fact, be much larger than 1). This implies that there are many integer constants b and c such that the function:
- f(n) = 4n2 + bn + c
Remarkably, in a passage from his 1956 novel The City and the Stars, author Arthur C. Clarke describes the prime spiral seven years before it was discovered by Ulam. Apparently, Clarke did not notice the pattern revealed by the Prime Spiral because he "never actually performed this thought experiment."
According to Ed Pegg, Jr., the herpetologist Laurence M. Klauber proposed the use of a prime number spiral in finding prime-rich quadratic polynomials in 1932, more than thirty years prior to Ulam's discovery.
 Hardy and Littlewood's Conjecture FIn their famous 1923 paper on the Goldbach Conjecture, Hardy and Littlewood stated a series of conjectures, one of which, if true, would explain some of the striking features of the Ulam spiral. 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. Conjecture F provides a formula that can be used to estimate the density of primes along such rays. It implies that there will be considerable variability in the density along different rays. In particular, the density is highly sensitive to the discriminant of the polynomial, b2−16c.
Conjecture F is concerned with polynomials of the form ax2+bx+c where a, b, and c are integers and a is positive. If the coefficients contain a common factor greater than 1 or if the discriminant Δ=b2−4ac is a perfect square, the polynomial factorizes and therefore produces composite numbers as x takes the values 0, 1, 2, ... (except possibly for one or two values of x where one of the factors equals 1). Moreover, if a+b and c are both even, the polynomial produces only even values, and is therefore composite except possibly for the value 2. Hardy and Littlewood assert that, apart from these situations, ax2+bx+c takes prime values infinitely often as x takes the values 0, 1, 2, ... This statement is a special case of an earlier conjecture of Bunyakovsky and remains open. Hardy and Littlewood further assert that, asymptotically, the number P(n) of primes of the form ax2+bx+c and less than n is given by
 Sacks spiralArchimedean spiral rather than the square spiral used by Ulam, and are spaced so that one perfect square occurs in each full rotation. (In the Ulam spiral, two squares occur in each rotation.) Euler's prime-generating polynomial, x2−x+41, now appears as a single curve as x takes the values 0, 1, 2, ... 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.)
Triangles of Lagrang: