Visualizing Primes in 2D

 

These images were produced by a program I wrote based on a remarkably simple algorithm. It has been noted, that some of them do not look unlike photographs taken of deep space nebula, interstellar clouds of gas and dust.

When we compare these images to random graphics produced by the same method, we see they are significantly more condensed, and visualize some order in the distribution.

All images are can be clicked on !

You'll have to scroll down and right on some of these images to see the prime data.

A comparison between these images and similar random images

 

Creating these images

Move a plotter around (up,down,left,right) based on a modulo of the primes, and increment the colour value when a pixel is overwritten. In more detail, here is some pseudo-code:

 

let position (0,0).
let counter = 0;

Repeat {
if (counter is a prime)
{
let x = mod(counter,11);

if(x=1) move position up;
else if(x=2) move position down;
else if(x=3) move position right;
else if(x=4) move position left;
else if(x=5) move position up;

increment colour of pixel at position;
increment counter 1;
}

 

Back to Pulchritudinous Primes