[Jprogramming] Ulam's spiral

David Lambert b49p23tivg at stny.rr.com
Sun Aug 17 23:27:41 UTC 2014


How does Ulam's spiral appear if we map the integers before primality test?
Here I've used Euler's polynomial, and other than creating a dense map, 
I don't see a striking pattern.  However, you might be motivated to try 
other transformations...I recommend to try verbs that map integers to 
odd integers...


NB. run time 10 minutes for pixel resolution.
load 'viewmat'
r=:|.@:|:
s=:(,. (>:@:(>./)@:, + [: i. #))@:r
NB. Ulam=:1 :'2!:0''display ~/j64-802-user/temp/viewmat.bmp''[viewmat 1 
p: u s ^:(360*2) i.1 1x'
Ulam=:1 :'viewmat 1 p: u s ^:(360*2) i.1 1x'
41 1 1x&p.Ulam''



More information about the Programming mailing list