Ulam spiral generator (see http://en.wikipedia.org/wiki/Ulam_spiral)