## Prime Space: The Shapes of Numbers

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. The numbers 9, 30, and 100 shown as objects in a 3D prime power space.

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 21 * 51; 900, and no other number, is 22 * 32 * 52, etc.

This means you can think of all the powers of any particular prime, say 20, 21, 22, 23, 24, 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. The numbers 24036, 36241, 24505, 81144, and 90917 shown as objects in a 3D prime power space. The prime power axes are more obvious here. The numbers 8198190 and 99198099000. Yup, that second one is 99 billion and change. The top/bottom reflection symmetry is because the prime factorization of these two numbers are 2 * 3^2 *5 * 7^2 * 11 * 13^2 and 2^3 * 3^2 * 5^3 * 7^2 * 11^3 * 13^2. You can enter numbers in the demo application this way too. The numbers 171893 and 171893.