Is the Ulam Spiral just a coincidence? I noticed that if you lay out the Ulam spiral and then circle all the even numbers, it displays a perfect array of diagonal lines. If this is true, then naturally you would see diagonal lines in the Ulam Spiral with prime numbers, because they would have to lie between the even diagonal lines (Primes cannot be even, except for $2$). To me the broken up diagonal lines of the Ulam spiral just seem to be an illusion, because of the prime numbers' forced existence on the odd diagonal lines.
 A: Your first observation is correct: except for the prime 2, all of the even lines in the number spiral are devoid of primes.  But that is not the main point.  If you focus only on the odd lines, it is evident that some have a lot of primes, some have a middling number, some have very few, and some have almost none.  It is this wide variance that people find striking (but not wholly unexpected—see the Wikipedia article for some insight into why these density variances occur).
Some things you can try:


*

*make an Ulam spiral with only odd numbers.  The absence of the empty even lines makes it harder to see what's going on, but you should still be able to detect the same variations in density as in the usual Ulam spiral.

*make a number spiral (with both even and odd numbers).  Instead of marking the primes, mark odd numbers randomly, letting the probability that $n$ is marked be $1/\log(n)$.  (This is roughly proportional to the probability that $n$ is prime.)  The result will not have anything like the density variances that are seen in the Ulam spiral, which tells you that this is not simply an odd/even effect.
A: The Ulam spiral is formed by the numbers written in the form $6n \pm 1$. In other words, any number that is not a multiple of 2 and 3 is written in this format. Therefore any prime greater than 3 will have the form $6n \pm 1$. Because the primes are dense at the beginning they cover many of these points in the Ulam spiral. As we move into larger range of numbers, the primers are diluted and the Ulam spiral fades.
