Hacker News new | ask | show | jobs
by jonp 5006 days ago
Here's a JavaScript/HTML5/Canvas version.

You can view the first 100 diagrams in a grid or view the diagram for the N of your choice. There's also an option to view an alternative diagram where the drawing starts with the smallest prime instead of the smallest.

http://jsfiddle.net/FEKX2/3/

3 comments

I noticed the author speculating about color, so I colorized it based on the identity of the largest prime:

http://jsfiddle.net/HEHHj/2/

It actually uses the last prime drawn, so it's only useful in 'smallest first' mode. That ought to be fixed, but I was lazy about it.

Colorizing the image based on the largest prime makes the pattern intelligible a little bit longer, before it becomes impossible to tell the big primes apart.

> var PI = 355 / 113;

You know about Math.PI?

I'm curious about this line, too. I wonder if it's maybe just a wee joke
If it's a droll reference to that thread last week about how there are no useful rational approximations, then "whoosh" and well played, sir:)
Arg! You beat me to it.