Prime Spirals / Ulam Spirals : A java program

A few days back i was watching a video on YouTube uploaded by Numberphile (video below) and i was quite fascinated by it. Fascination led to implementation and the thought of implementation led to code. Oh! I must admit that that the thought of looking cool once i achieved this did cross my mind :). Below is the code and a screenshot of the plot of prime numbers as seen in the video. The spiral is called the Ulam Spiral after the mathematician Stanislaw Ulam. You can find the Wikipedia article here. Don’t forget to read up on how Ulam came up with this spiral.

Nice job! 🙂
The primes appear to have some sort of a hidden pattern, because they also showed a random mapping which appeared to be truly random, but this.. this is something else, it clearly has a hidden pattern, no one can deny that! What say you master yoda..??