I know that we can write a very large number such as 5040 in only 7!, and imagine I want to store this number in a binary file with the least number of bits.
Saving 5040 takes 13 bits of space, while saving it as 7 (knowing that 7 means 7!) takes only 3 bits. That occupies 4 times less space in a file.
Now I want to show numbers fro 0 to 4096, and if it's not possible, numbers 0 to 255 in any way that it takes less space to store it in binary systems.
I'm looking for ANY KIND OF WAYS (Fibonacci, Factorial, Algebra, Geometric positions, etc.) to do it in an efficient way. I welcome any idea about it. Thank you.
Via pigeonhole principle, you can't, if you want lossless compression. any compression algorithm that force some lower in bitstring length, will force others higher if it avoids overlap and is therefore lossless.