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''

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to