This is a WebGL interactive 3D experiment in visualizing numbers as shapes using three.js. This was inspired by midnight musings on visualizing numbers as objects in a kind of space constructed using prime number powers as directions.

In physics there is a concept used in quantum theory called Hilbert Space, which is an infinite dimensional space of orthogonal directions, to simplify greatly. You might suspect, and you would be correct, that Hilbert spaces are not a topic of burning interest for most people.

But there is a somewhat analogous infinite dimensional space that we all use every day without even realizing it. We regularly manipulate things in this space, and create new things in it. This is the "space" of prime numbers raised to various powers. Prime Space.

When you do anything with integers, you are operating with objects in prime space. In prime space every number can be seen as having a shape. This is all down to something called the fundamental theorem of arithmetic. I want to give you a chance to visualize prime space in action. When you click the button at the upper right you'll see an interactive three dimensional projection of one way of representing prime space wherein you can see the "shapes" of integers and look at them from all sides.

You probably already know, without knowing that you know, the fundamental theorem of arithmetic. It just states that every positive integer has a unique representation, shared by no other integer, as a product of various primes to various powers. Thus 10, and 10 alone, equals 2^{1} * 5^{1}; 900, and no other number, is 2^{2} * 3^{2} * 5^{2}, etc.

This means you can think of all the powers of any particular prime, say 2^{0}, 2^{1}, 2^{2}, 2^{3}, 2^{4}, etc., as one (logarithmic) axis or direction in prime space. Likewise for each prime. Thus if we have a way to show as many of these axes as needed for some set of numbers, we can see and play around with them as shapes in prime space.

Of course, we can't directly display more than two dimensions on a screen without some distortion or arbitrariness being involved (think of a Mercator projection of a sphere projected onto a flat map) so I've somewhat arbitrarily chosen two possible ways of doing this for illustration. You can switch between these two approaches in the primes space demo:

Right Cone:

Each prime power axis is a ray on a right cone. The origin, or tip of the cone, is the shared point where all primes are raised to the power zero, that is, one. In addition, for any set of values to be displayed, the prime space cone only contains prime power axes for primes actually used by the values of interest. These prime direction axes are distributed equally around the cone.

Cylinder:

Each prime power axis is a vertical ray on a cylinder. The origin, the shared point where all primes are raised to the power zero, is placed at center of the bottom of the cylinder. As with the cone, for any set of values to be displayed the cylinder contains only prime power axes for primes actually used by the values of interest. These prime direction axes are distributed equally around the cylinder.