I have a set of $n$ attributes $A$, i.e. {$A_1, A_2, .. , A_n$}. Each attribute has $m : m > 0$ possible values, which we can call $V_{a,m}$.
I also have a population of objects, which are uniquely identified by the values of the attributes they possess. Each object will have 0 or more attributes; each attribute they possess will have exactly one of the possible values. The attributes fully description the population of objects, and there is a maximum of one object that has any combination of attributes.
Thus I can identify any object uniquely using the set of values that apply to it. e.g. if object $O_x$ has only attributes $A_1$ and $A_2$ with values $V_{1,20}$ and $V_{2,5}$, I can say that $${V_{1,20},V_{2,5} \to O_x }$$
I'm trying to reduce the map of attributes to a single number - think of this as a Godel Number. My current approach is to leverage Godel's prime factor encoding, so that
$$V_{1,20},V_{2,5} \to 2^{20} * 3^5 \to 254803968$$
or more generally, $V_{a,m} \to (p_a)^m$ where $p_a$ is the $a$th prime number. This guarantees uniqueness but the new number quickly becomes too large.
Question: Is there any way to reduce the new number to a manageable size, e.g. modulo some large prime? My mind connects back to the Chinese remainder theorem but I'm not able to piece together the pieces.
For reference, I am working with $n < 20$ and $m < 200$.
Why do you have to use a Godel encoding? Just use a base $(m+1)$ encoding, where $A_1$ is the least significant digit, $A_2$ is the next, and so on, and a $0$ digit means the attribute is absent, while a digit from $1$ to $m$ indicates that that attribute is present and has one of the $m$ possible values. This allows you to have arbitrary finite length of the attribute list without any collision. To decode use integer division by $(m+1)$ with remainder.