Is there a specific name for this counting system?

61 Views Asked by At

I needed a counting system that goes like in the spreadsheet below.

The columns are different representations of the same counting system.

Given a limit of X digits (5 in this example), we count by adding digits first. Once we we hit X digits, we have to increment the oldest digit accordingly.

In this system, counting to 5 would be like: 1, 11, 111, 1111, 11111. If we wanted to represent 6, we'd use 2. 7 would be 21, then 8 is 211 and so on. Until we fill out the 5 digits with 2s. Then we'd move onto 3 and begin again: 3, 31, 311, 3111, 31111, 32, 321, 3211, etc.

My example above is column 3, but the same logic applies with emojis, letters, or placing the new digits in front like column 4 instead.

I was curious if there is a name for this counting system, or if there is a known function/algorithm for generating the digits of this system given a base10 digit.

So, f(8) = 211 if using column 3 or f(8) = 112 if using column 4 in the picture.

Example of counting system

1

There are 1 best solutions below

0
On BEST ANSWER

This can be viewed as a modification of the combinadics system, where one uses multisets instead of sets.

Looking at your third column, let me first give a function which takes in a string like 22110, and tells us that the string occurs in row $13$ of the table. The rule is: $$ \newcommand\mchoose[2]{\left(\!\!{#1 \choose #2}\!\!\right)} \text{index}(d_nd_{n-1}\cdots d_1)=\mchoose{d_n}{n}+\mchoose{d_{n-1}}{n-1}+\dots+\mchoose{d_1}1 $$ Here, $\mchoose nk$ is the multichoose coefficient, defined by $$ \mchoose nk=\binom{n+k-1}k=\frac{(n+k-1)!}{(n-1)!\cdot k!} $$ Therefore, $\text{index}(22110)=\mchoose 25+\mchoose24+\mchoose13+\mchoose12+\mchoose01=6+5+1+1+0=13.$

This shows that your system is weird kind of positional number system. Whereas radix systems have a fixed number of digits, but unlimited length, your number system has a fixed length, but infinitely many possible digits. Furthermore, the digits are interdependent, in that $0\le d_1\le d_2\le \dots \le d_n$ must be a weakly increasing sequence. As you march through these strings in the order of their index, you enumerate the multi-subsets of the nonnegative integers with cardinality $5$ in lexicographic order. If you instead encode your sequences in increasing order, like $d_1d_2\dots d_n$, then the indexing comes from the colexicographic order.

The combinadics system is very similar. Instead, the valid digit sequences must be strictly increasing, $0\le d_1<d_2<\dots<d_n$, and we replace the multichoose coefficients in the index formula with regular binomial coefficients.