Recently I saw a geeky discussion about the pros and cons of different ways of representing numbers. It reminded me of a way to represent numbers I came up with around 1999. I'm guessing someone else has thought of this, but I've never found a reference to it despite asking a few math professors about it. Anyways, I thought I'd describe it breifly and make some code to demonstrate it.

The most common numbering systems we know use positional notation. This includes our every-day base-10 numbers, binary, and hexadecimal. Those systems are nice and methodical, and the length of the representation grows logrithmicaly with the size of the number, which is nice. I won't talk about ugly representations of numbers like Roman Numerals. Of the positional systems, binary is the most minimal because it only relies on two symbols 0 and 1.

While it's kind of silly, I also like to think about the base-1 system, which results in simply putting as many markers $\cdot$ as the number. For instance, 3 would be denoted $\cdot\cdot\cdot$. It's really minimal, you only need one symbol, but the lenth of the representation of the number grows linearly with the number.

Now there is a totally different way of representing integers that is elegant from the point of view of a pure mathematician or number theorist. It's called the Canonical representation of a positive integer. Fancy name, here's the idea: Every positive integer $n > 1$ can be represented in exactly one way as a product of prime powers:

where $p_1 < p_2 < \dots < p_k$ are primes and the $\alpha_i$ are positive integers.
There's no need to explicitly list the primes because they are so fundamental, and they mean something totally independent of how we choose to write the numbers down. So we could just keep track of the powers $(\alpha_1, \alpha_2, \dots, \alpha_k)$. For example, 1200 = 24 × 31 × 52 = 3 × 2 × 2 × 2 × 2 × 5 × 5 = $2^4 3^1 5^2$, and in this representation we can just write $(4,1,2)$.

The length of canonical representation has a complicated behavior with $n$. Sometimes you have a very compact representation. The representation is longest for prime numbers, and shortest for powers of 2. This is clearly related to the Mersenne Primes that have the form $2^n-1$.

I like the canonical representation or prime number decomposition because it is so closely related to number theory. The problem though is that when we wrote $(4,1,2)$ we had to decide how to write down 4, 1, and 2 -- isn't the point of this that we are trying to find a nice way to represent numbers? Why am I using base-10 to encode the powers $\alpha_i$?

What if I just recursively apply the prime number decomposition to the powers $\alpha_i$? Eventually I will get to the point that the $\alpha_i$ are 0's or 1's.
In our example 1200 = $2^4 3^1 5^2 = (4,1,2)$. I would just do the same for 4, 1, and 2.
Let's start with 4, I know $4=2^2=(2)$, now I recurse once more and I get to $2=(1)$. Put it back together and I have $4=((1))$. So I can write 1200 = (4,1,2) = (((1)),1,(1)).

Perfect, now I have a way of writing down the integers that has the best properties:

minimal number of symbols (like binary)

nice relationship to number theory (like the canonical representation)

I haven't worked it out, but it seems like the "multiplication tables" in this notation may be natural for "hyper-operations". For instance, after the "tetration" of $a\uparrow\uparrow b$ there is $a\uparrow\uparrow\uparrow b$ (also written or $a\uparrow^3 b$) "pentation". The only reasonably sized example is $2\uparrow^3 2 = 65536$. But we already did that one because $2\uparrow^3 2 = 2^{2^{2^2}} = 2\uparrow^2 4 = 65536$.

(Side note: This idea of recursively defining the hyperoperations is related to Ackermann's Function, which I learned about while taking a graduate computability class in Madison, WI back in the day. )

looks tempting. I wish I could do $2\uparrow^3 4$, but it is a huge number. The only other practical example is:
$3\uparrow^3 2 = 3^{3^3} = 7625597484987$