I don't know this subject so my question may not be expressed in the accurate form.
Is there a function, or a structure, that generates any desired sequence of 0 and 1 of length n? Assume we can pad the sequence if we need to, that means if the function has to adhere to a special pattern, we can make the sequence have that pattern, but still has to have the n original 0,1 sequence embedded.
I may be misunderstanding your question, but I want to say that every finite binary sequence can be represented uniquely by a natural number:
For a binary sequence $b_1,b_2,...,b_n$, form the related binary sequence $1,b_1,b_2,...,b_n$ (the $1$ is added so as to distinguish between various numbers of leading $0$s in the original sequence). Convert this related binary sequence to a natural number via $2^n+2^{n-1}b_1+\cdots+2b_{n-1}+b_n$.
For instance $0,0,1,0,1\leftrightarrow 1,0,0,1,0,1\leftrightarrow 37$.
I think, this correspondence is unique in both directions. (I could not tell from your post which direction you wanted the correspondence to go.)