How to create a function that returns original inputs from generated output, with no prior knowledge of inputs? I'm looking for a way to convert 4 numbers into 1 number, then convert that 1 number back into the original inputs with no knowledge of said inputs.


*

*4 Numbers

*Convert into 1 number (summing/multiplying/anything)

*Use the result to generate the original 4 numbers.


Example:
Four Original numbers:
a = 2;
b = 5;
c = 10;
d = 1;
Combined number:
x = 2 + 5 + 10 + 1
x = 18
One function or 4 functions to generate original numbers only using x:
f(x) -->
a = 2;
b = 5;
c = 10;
d = 1;
(9 numbers would also be appreciated if this problem is possible)
 A: If the four numbers are integers that come from a reasonably small range, positional notation is your friend.
For example, if you know $a,b,c,d$ are all between $0$ and $999$ you can simply concatenate their three decimal digit representations, padding with $0$ as needed, so
$$
f(2,5,10,1) = 002005010001
$$
This is the simplest example of a very general idea. If you want to store $k$ nonnegative integers each less than $b$ you can stuff them into a $k$ digit number in base $b$. That will produce an output less than $k^b$. The algorithms for packing and upacking numbers in arbitrary bases are easy and already implemented in most modern programming languages.
A: If you four numbers are integers, then a classical approach would be to send the four numbers $a$, $b$, $c$ and $d$ to the single number
$$f(a,b,c,d):=2^a3^b5^c7^d.$$
By unique factorization, you can get your four numbers back from this single number by factoring it. 
Of course the same idea works for nine integers; simply throw in the next five prime numbers.
A: You could map the tuple $2,5,10,1$ to the character string 2,5,10,1
and then replace each digit with a pair of equal digits, resulting in 22,55,1100,11 and then replace the commas with a pair of unequal digits, resulting in (say) 2291559111009111.
And so on.  This  recipe is easy to implement on a computer but perhaps hard to write down with algebraic expressions. 
