# Primes

## Primes - Web Visualization

### What is a prime number?

A prime number is the smallest building block of other numbers (1 is an exception because it is a unit). Prime numbers can’t be “built” with multiplication except by 1 and the number itself. All nonprime numbers can be built with just prime numbers.

For example: 2, 3, and 5 are primes while 4 and 6 are not. 4 can be made by multiplying 2 by 2. 6 can be made by multiplying 2 by 3. Etc...

### What use are prime numbers?

Some cicadas have evolved to emerge from underground on a prime number frequency (7, 13, or 17 years). A predator of these cicadas would have to evolve to show up every year or exactly 7, 13, or 17 years to completely wipe out the cicadas. If the predator only showed up every other year (every 2 years), it would only sync up with the cicadas every other time they emerged (year 14, 26, 34). Granted, the cicadas overwhelm regular predators with the cicada’s huge numbers to make sure they survive but you can see how a specialized predator would have to sync up exactly with the cicadas to completely wipe them out.

Prime numbers are also used in some cryptography algorithms. The algorithms assume that it is easier to multiply two number together than it is to figure out what numbers went in to a number. For example: 2 x 17 is easier to figure out than figuring out what primes went in to 45.

### Why did I made this project?

Currently, there is no easy way to figure out what numbers are prime. There are an infinite number of primes and it gets harder and harder to figure out which of those big numbers are prime. I was thinking that it would be interesting to graph the difference between the primes (3-2 =1, 5-3=2, etc…) and see if there was a pattern. Once I saw what that looked like, I thought it would be interesting to see it in 3d as well. I doubt there is a visible pattern in either of the dimensions but the visualization ended up looking pretty awesome.

### What is going on in the visualization?

The visualization is taking the difference between the current prime number and the next prime and plotting a line of that size on the drawing surface. The next line is plotted in the next dimension (x, y, z). Once a line is plotted in each dimension, it starts to plot them in the negative dimensions (-x, -y, -z). The colors are just a way to help differentiate between different primes.

The 3d drawing surface is a project called threejs.