Given the set $S$ of all possible sequences within bounds $[1, 31]$ with $n$ elements (where $n$ is constant and $ 1 < n < 32$) and a set $L \subset \{0, 1, 2, \dots, 2^{64}\}$ where $|L| = |S|$, does there exist a function $f$, so that the binary relation $R: S \times L$ is injective?
Actual use case (computer science):
I have a non-strict weak ordered list of constant length $1 < n < 32$ with integers in range $[1, 31]$. I want to know if it's possible to unqiuely map each list to a 64 bit integer. The mapping is one-way only, so I don't need to map an integer back to a list.
If $\mathbf a = (a_0,a_1,\ldots, a_{n-1})$ is a non-decreasing sequence of non-negative integers, we can defined $$f(\mathbf a)=\sum_{i=0}^{n-1}2^{a_i+i}.$$ With this definition, $\mathbf a\ne\mathbf b$ implies $f(\mathbf a)\ne f(\mathbf b)$. Additionally, $$ 2^n-1\le f(\mathbf a)<2^{n+a_n}.$$ With your constraints, this means $f(\mathbf a)<2^{64}$, as desired.