The Ulam Spiral of Primes (2010)
scienceblogs.com
scienceblogs.com
https://math.stackexchange.com/questions/1338059/why-are-the...
I am not particularly talented with programming mathematical quandaries, but if anyone else wanted to analyze this further, it could perhaps be an avenue to interesting results.
I worked through your example for the integers 8 to 16, the sequence being 3 2 3 0 1 0 3 2 3.
The sequence of numbers we observe is due entirely to the locations of the primes 5, 7, 11, 13, 17, and 19.
The differences between these primes is 2, 4, 2, 4, 2, which is again a palindrome. I wouldn't be surprised if that's the reason your original sequence is palindromic. If it is, the question is then whether palindromes in distances between primes are unusually common.
A lot of references for that sequence.
Fascinating stuff... The palindrome observation of the OP might just be that we are good at finding patterns and there are limited numbers of distances with lower numbered primes (and from the graph of your reference it looks like a lot of the distances are concentrated in smaller numbers -- max dist increasing logarithmically?)
I wonder if the palindrome conjecture can be posed mathematically or algorithmically (seems like it should). It would be interesting to test palindromes to a certain number compared to palindromes of a similarly distributed set of random numbers. Counting all palindromes of any size will probably be a significant big O.
Now I'm just trying to keep myself from looking at the Collatz Conjecture. :)
There are also third-order prime polynomials, which you might be able to see when visualizing the primes in 3d.
[1]: http://mathworld.wolfram.com/Prime-GeneratingPolynomial.html
Also, prime series are palindromic. Integers relatively prime to (2, 3, ... p[m]) form a repeating series with period 2 * 3 * ... * p[m], and within each series they are the integers not "knocked out" by the given primes; e.g., 2 * 3 * ... * p[m] +/- [p[m+1], p[m+2], ...]. So the pattern is symmetrical over the period.
I have saved the graph here: https://github.com/mycask/rsa-graph
Spoiler Alert: The section named 'Streaks' right after the graph plot has spoilers.
And another one with a different technique ("viewed as a surface such that -1 is a prime and 0 is a composite number"): https://www.youtube.com/watch?v=ECgsgC13ILg
Trying picking random points on the black squares of a chessboard (same condition that you stated), they won't make obvious lines like that.
Moreover, the clustering is not limited to just diagonal lines. There are less prominent but high density clusters along horizontal and vertical lines too.
I have plotted a 99x99 grid in this experiment. One can plot larger grids to see that the difference between the two grids (the Ulam spiral and the random spiral) becomes more apparent with larger sizes.
Update: After I made these text-plots, I found that Wikipedia has much better graphical plots that demonstrates the difference:
- Ulam spiral: https://en.wikipedia.org/wiki/File:Ulam_1.png
- Random spiral: https://en.wikipedia.org/wiki/File:Randomly_black_odd_number...
This doesn't seem to take into account that big prime numbers are less "likely" than small ones.
Maybe using a sort of contrast algorithm like autofocus for a camera. If it looks noisy and random, then that's not an interesting visualizations.
I have this nagging idea, though, that there must be a deep relationship among: 1. the polynomials on which the primes are clustered in the Ulam spiral, 2. algorithms to factor numbers, and 3. recovering information “destroyed” by addition. That is, if you ask me to find the factors of C = A × B, the information about which prime factors went into that product is preserved by multiplication, but if you ask me for the factors of C = A + B, I can’t say much about how the factors of A and B relate to those of C, can I? But if I could, I suspect I could factor numbers efficiently. Something something information theory something entropy…
Anyone have any pointers to reading materials along these lines?
The 2d spiral has these really nice properties that contiguous numbers are adjacent, it is approximately symmetric for any rotation in R2, and each number is only +ε farther away from the origin.
[1]http://vgalt.com/wp-content/uploads/2009/10/3d-labyrinth.jpg
Turns out the additive sequence to never hit any multiples of 2 or 3 is {+4, +2}
Not much more complex than 'only the odd squares' yet now we are eliminating many more false positives.
We can continue to construct the additive sequences for the first N primes. This is known as the First Differences of Reduced Residue Systems Modulo Primorials. Hardy and Littlewood studied the statistical dynamics of these ordered sets.
He also sells a t-shirt with it for the music or math nerds interested: https://everpress.com/max-cooper
If so, I would expect those to wash out a little for larger squares. I have some plotting to do when I get home
Or rather the non-corners.
Well, probably not.
Should be “n and c”.