Writing Short Equations/Equivalents For A Group Of Numbers.

57 Views Asked by At

I have a series of numbers between 0 to 16,000,000. It's certainly possible to describe some (if not all) of these numbers with some equations. For example, it's possible to write 720 as 6! and 5040 as 7!. There are some numbers that can be described by Factorial, some by Fibonacci, some by other equations.

How can I find the shortest possible equations (or equivalents) to each (or some numbers)? Is there any source (website/etc.) you know that can do it? Or is there any mathematical way to do it by myself?

1

There are 1 best solutions below

2
On

You've explained in comments that you'd like to do this in order to store the numbers more efficiently. Let me explain why I don't think this will work (assuming there's no pattern to the values).

The problem is that the information in each number has to be stored somehow. Making the format more efficient for some entries doesn't make any information go away—it just moves it somewhere else.

To see it, let's consider a much smaller set of entries.

Suppose you want to store $8$ binary numbers, of $8$ bits each. That's $64$ bits altogether, and each entry has $2^8=256$ possible values.

Suppose that a quarter of the possible values for an entry have a shorter representation than $8$ bits. That shorter representation now has to distinguish between $64=2^6$ different values, so needs $6$ bits instead of $8$.

However, every entry now needs an extra bit, which specifies whether to use the longer format or the shorter one. So the actual length of each entry is now $9$ bits for a standard one, and $7$ bits for a short one.

In a typical set of $8$ entries there'll be $6$ standard entries and $2$ short entries.

So we have to store $6\cdot9=54$ bits for the long entries, and $2\cdot7=14$ for the short ones, making a total of $68$ bits instead of the original $64$. We've actually increased the number of bits overall.

Your idea of saving space by using short formulas for some of the numbers is a nice one, but in the end it will come up against this problem. Decreasing the storage needed for a subset of the entries increases the storage needed for the others, and ultimately a random $n$-bit number still needs $n$ bits of storage.