I would like an "algorithm" to find the smallest number that can represent a list of numbers exactly, order included.
As an example, if a list is [2 3 4 6 9], I would like an algorithm to yield a number X such that X contains the information and order of each number in the list so that I can "reverse" X back into the list.
As an example, I have come up with what might be an inefficient algorithm, but one that works nevertheless.
As there are 5 numbers in the list, let us consider five other numbers a,b,c,d and e. We replace 'a' with the first number in the list. We replace 'b' with the sum of the first two numbers. Replace 'c' with the sum of the first three numbers and so on.
In this case, we have a,b,c,d and e equal to 2, 5, 9, 15, and 24. Now I replace each number with a prime number of that index. That is, 2 is replaced by the 2nd prime number. 5 by the 5th prime number and so on. So now we have 5 prime numbers, each larger than the previous one. On multiplying the 5 numbers, we come up with a large number which has these prime numbers as their only prime factors and when considered ascendingly, the order is maintained. So when we just backtrack our steps, we get back the original set of numbers.
This method, although it works, yields quite large products. Is there a better algorithm that I can use that will yield numbers that are a lot smaller than this? If not, and I know this is definitely not the right place to ask, can someone help me come up with one?
I believe it could be useful in information theory.