Suppose I have a sequence of numbers: {n, n+1, n+2, ... n + m}
Without storing the numbers ahead of time I want to create a function f(), which given the sequence {1,2,3
Your input is described by f(x) => x + 9
, or more generally f(x) => n - 1 + x
as x
starts at 1.
You link to another question which describes a function r(x)
which maps x to a shuffled value, 0 <= r(x) <= m
.
so f(r(x) + 1)
or (r(x) + n)
should give you the value you want.
For small m
, you also should be able to find seeds of a standard random number generator by trail and error which then generate m+1
distinct values when taken mod m+1
if you don't want to code your own generator.