While playing around with primes and C some more, I put together some plots with Mathematica dealing with the distance between primes. The prime numbers are plotted, with the n’th prime on the x-axis and the difference between it and the last prime on the y-axis. After all, I’ve got gigabytes of primes sitting around.. got to figure out something to do with them other than test my RAM while generating them.
The first 1,000 primes,
Of course, primes can’t be odd numbers apart, because that would make them even. That explains the pattern a bit. Still, for something that has baffled mathematicians for centuries, it certainly does seem like there’s a pattern to it. If you draw lines between the points,
Certainly not as pretty.
The first 10,000 primes,
The scale makes this one a bit less interesting. Too much overlap, but Mathematica really doesn’t like big listplots like this. I even crashed it a few times when I tried to do a listplot of 100,000 data plots. 10,000 was pushing it.
A random sampling of 1,000 primes (between the 90 millionth and 90 million 1 thousandth prime),
More interesting patterns in primes, the Ulam spiral. Starting at 1 and spiraling outwords from the orgin, you create a graph like so (http://en.wikipedia.org/wiki/Ulam_spiral),
And then remove all but the primes (http://en.wikipedia.org/wiki/File:Ulam-Spirale2.png),
And you find an intersting pattern, that the prime numbers tend to lay along some diagnols more oftan than others. Expanding this to 150,000 primes,