
Ulam spiral - conductor
https://en.wikipedia.org/wiki/Ulam_spiral
======
prezjordan
Stanislav Ulam is an incredible man. Mathematician (Ulam Spiral, Monte Carlo
Method), Manhattan Project participant, and part-time astronomer who devised a
method for nuclear-explosive-powered space travel [0].

[0]:
[http://en.wikipedia.org/wiki/Nuclear_pulse_propulsion](http://en.wikipedia.org/wiki/Nuclear_pulse_propulsion)

~~~
stiff
It's Stanislaw, since he was Polish, Stanislav would be a Russian name. He is
most importantly the co-inventor of the hydrogen bomb:

[http://en.wikipedia.org/wiki/Thermonuclear_weapon](http://en.wikipedia.org/wiki/Thermonuclear_weapon)

There is a great autobiography by him called "Adventures of Mathematician".

~~~
lutusp
> There is a great autobiography by him called "Adventures of Mathematician".

A terrific book, still available but pricey (ca. $30 for a paperback). I have
a dog-eared copy acquired 40 years ago in my library.

The closest Ulam comes to revealing atomic secrets in his book is to say the
method he and Teller chose to produce a thermonuclear reaction requires the
"repetition of certain arrangements." I always thought that was the perfection
of obscurity.

------
oscilloscope
Here's an interactive Ulam spiral with adjustable parameters.

[http://bl.ocks.org/syntagmatic/5070320](http://bl.ocks.org/syntagmatic/5070320)

Open it fullscreen, lower the size and increase the "max" variable to render
more numbers. If you've got a Retina display, the size goes down to 0.5 to
take advantage of that. You'll see the long diagonal lines mentioned in the
article.

------
rcthompson
Another perhaps surprising aspect, to me at least, is the apparent uniformity
of the density of prime numbers in the plane. It's my understanding that the
density of the prime numbers decreases as you go higher [1], so why does the
plane look so uniformly covered?

[1]
[http://en.wikipedia.org/wiki/Prime_number_theorem](http://en.wikipedia.org/wiki/Prime_number_theorem)

~~~
yetanotherphd
The density of primes is 1/log(n), so it does drop off, but not so fast that
it would be obvious for small numbers.

I tried creating giant Ulam spirals one time, and I did correct for this,
which made it look a lot more uniform.

I had initially hoped to find new patterns this way, but nothing turned up.
While numerical experiments are fun, there are a huge number of potential
avenues that could be explored. Finding the interesting ones is basically what
mathematics is.

~~~
darkmighty
How did you correct for it? Did you just nonlinearly scale the final picture
or did you scale the axis on the spiral itself and then sampled the result?

~~~
yetanotherphd
I was producing grey scale images where each pixel represented a block of
numbers. The count in each block was divided by the density of primes
(1/log(n)) at the center of the block.

However, this actually made the middle turn grey, because even though the mean
value of each pixel was the same, the variance wasn't. So then I corrected for
this by calculating a "z-score" instead.

But like I mentioned before, it didn't turn up any interesting patterns.

~~~
darkmighty
Very interesting!

I guess it specifically didn't turn up interesting patterns because a) you
correct for density b) the distribution of primes is "noisy" (which is why
they're so puzzling) and by averaging out the noise you get a fairly flat
distribution

------
bd
I did a visualization of Ulam spiral a while ago with JS canvas when it was
posted here on HN before:

[http://alteredqualia.com/visualization/ulam-
spiral.html](http://alteredqualia.com/visualization/ulam-spiral.html)

[https://news.ycombinator.com/item?id=1452301](https://news.ycombinator.com/item?id=1452301)

------
eknkc
Basic explanataion:
[http://www.youtube.com/watch?v=iFuR97YcSLM](http://www.youtube.com/watch?v=iFuR97YcSLM)

BTW, these guys really love numbers and math, it's fun to watch their
enjoyment while explaining things like an Ulam spiral. And I think he's on
crack or something.

------
grinich
Here's a visualizer for the Ulam Spiral, Triangular, Pentagonal, Hilbert
Curve, and many more.

You can also visualize {2-5}-factor primes, superperfect numbers, smooth
numbers...

[http://www.bigblueboo.com/prime/](http://www.bigblueboo.com/prime/)

------
patrickyevsukov
I wrote a Java application to generate and save variations of the Ulam Spiral
a while back. The code is here: [https://github.com/PatrickYevsukov/Ulam-
Spiral-Explorer](https://github.com/PatrickYevsukov/Ulam-Spiral-Explorer) An
example of the output is here:
[https://twitter.com/PatrickYevsukov/status/35502312719085977...](https://twitter.com/PatrickYevsukov/status/355023127190859776)

------
cjlm
If you like this then you'll probably enjoy the visualizations on this
site[0].

[0] [http://www.numberspiral.com](http://www.numberspiral.com)

~~~
alxndr
Wow, those are pretty cool. Page 8 with the factor curves look really
interesting.

[http://www.numberspiral.com/art/19.gif](http://www.numberspiral.com/art/19.gif)

------
mrcactu5
Patterns related to Primes are difficult - outside present technology.

On MathOverflow, Joseph O'Rourke and Terence Tao offer more pretty pictures
and discussions on patterns related to the spiral
[http://mathoverflow.net/questions/102075/prime-spiral-
distri...](http://mathoverflow.net/questions/102075/prime-spiral-distribution-
into-quadrants)

------
jsmorph
Here's a colorization based on compositeness:

    
    
      http://blog.morphism.com/2010/05/building-numbers.html

------
arketyp
I wonder how this generalizes to higher dimensions.

~~~
mrcactu5
[http://math.stackexchange.com/questions/59369/prime-
spirals-...](http://math.stackexchange.com/questions/59369/prime-spirals-on-
surfaces-of-revolution)

------
csense
vihart talks about Ulam spiral, Pascal's Triangle, cellular automata:

[http://www.youtube.com/watch?v=Yhlv5Aeuo_k](http://www.youtube.com/watch?v=Yhlv5Aeuo_k)

------
coldcode
I tried 9.3 / 1 and it looks like a photograph record.

