Let's say I have $k$ integers in the range of $[1,m]$ that I should like to represent as a single integer, such that no two selections of $k$ integers that differ in at least one yield the same result and in a way that I can reconstruct - if necessary - each from the final result.
I know that for $k = 2$ and two integers $a,b$, we could:
$n:= (m+1)a + b$
and then
$b \equiv n \pmod{m+1}$
$a = \lfloor\frac{n}{m+1}\rfloor$
How can I generalise this to arbitrary $k$? Do I just continue the pattern, i.e.
$nn:= (m+3)((m+1)a + b) + c$
with
$ c \equiv nn \pmod{m+3}$
$n := \lfloor\frac{nn}{m+3}\rfloor$
$b \equiv n \pmod{m+1}$
$a = \lfloor\frac{n}{m+1}\rfloor$
etc. or ..?