Non-iterative deterministic function to map an input to a random output in range without repeating

55 Views Asked by At

Apologies if this has been answered before or is impossible, but:

Is there a state-independent, non-iterative function that, given an (integer) input (n) and (integer) minimum (min) and maximum (max) values, uniquely maps n to a pseudorandom (integer) output between min and max?

By non-iterative, I mean it wouldn't have to iterate through every number in the set from min to max in order to map n.

For example (I do not know LaTeX, sorry):

The function is defined as f(n, min, max)

f(1, 1, 5) = 5
f(2, 1, 5) = 2
f(3, 1, 5) = 4
f(4, 1, 5) = 1
and f(5, 1, 5) = 3

And similarly for other min and max values.