# Dictionary of Mathematical Eponymy: The Ulam Spiral

I’m a big fan of the doodle. My lecture notes, even my schoolbooks, are covered with geometric patterns and impossible shapes and simple cartoons.

Today’s entry in the Dictionary of Mathematical Eponymy started jumped out of Stanislaw Ulam’s notes while he was listening (according to Martin Gardner) to a ‘long and very boring paper’.

### What is the Ulam Spiral?

Write the number 1 in the middle of your notes. Above it, write 2. Let’s say we’re going to work clockwise: now write the number 3 to the right of the 2, 4 below it and 5 below that; 6 to the left, 7 to the left of that; then 8 above… in this way you generate a spiral of numbers like this:

```
10-11-12-13
| |
9 2--3 ...
| | |
8 1 4
| |
7--6--5
```

Just drawing it out is quite relaxing. But Ulam decided to colour in the prime numbers and was surprised to see that they appeared to lie in clear diagonal lines. Starting from numbers other than 1 gave even more prominent diagonals - for example, starting from 41 gives a very clear diagonal stripe.

### Why is it important?

Aside from being a really nice doodle to bring out when you’re bored, the Ulam spiral poses some interesting questions in number theory.

It is believed that some quadratics have a propensity for generating prime numbers - Euler pointed out that $x^2 - x + 41$ is an especially productive expression.

We don’t know whether any quadratic generates infinitely many primes, or even a large proportion - Hardy and Littlewood’s “Conjecture F” states that, if a quadratic related to a diagonal doesn’t factorise, it will contain infinitely many primes; for large $n$, the proportion of primes will be around $k\frac{\sqrt{n}}{\log(n)}$ for some $k$ that depends on the equation the diagonal satisfies.

### Who was Stanislaw Ulam?

Stanislaw Ulam (1909-1984) was a Polish mathematician, and had a hand in many of the 20th century’s most important topics.

He studied at Lwów under Kuratowski (he was responsible for several problems and solutions in the Scottish Book) before joining von Neumann at the IAS in Princeton in 1935.

In 1943, he joined the Manhattan project, and after the war (with Teller) came up with a working design for thermonuclear weaponry.

As part of his work on the bomb, he developed the idea of the Monte Carlo simulation - using large numbers of trials to generate estimates for probabilities.

He died of heart failure in Santa Fe, California in 1984.