How to generate unique (random) numbers that can be traced back to a unique source number?
The numbers $n$ (coding source) and $m$ (coding index for a given source) can be combined into a single  bitstring; e.g. with  $0\le m&lt;2^u$ and $0\le n&lt;2^v$, as a bitstring of $\lceil u+v\rceil$ bits. Then, converting that single bitstring into a unique random-like number can be done by encryption with a secure block cipher with block width $w\ge u+v$ bits and a fixed secret key (prefixing input with $w-\lceil u+v\rceil$ zero bits in order to reach the width $w$ of the block cipher). The random-like number will be an integer corresponding to the ciphertext bitstring, thus in range $[0\dots2^w-1]$.

Distinct pairs $(n,m)$ inputs allways lead to distinct output, because a block cipher is a permutation of its block space. Decryption (requiring the key) allows recovering the original bitstring from the random-like number, and from that $n$ and $m$. If one checks that what's deciphered could have been obtained from a valid $(n,m)$ (including $w-\lceil u+v\rceil$ zero leading bits), residual odds that a random bitstring is acceptable are $2^{u+v-w}$.

Using AES ($w=128$, regardless of key width) and $u=v=40$ ($n$ and $m$ up to about a trillion), these residual odds are $2^{-48}$. Problem is, the random-like number is up $2^{128}$ (about $39$ decimal digits). The classic 3DES ($w=64$) or the relatively unproven Speck ($w\in\{32,48,64,96,128\}$) are alternatives.

If you want a shorter unique random-like number (with as a counterpart higher residual odds that a random bitstring will be acceptable), or more choices for $w$, use format-preserving encryption; we have a number of questions about that.