Generate an Integer in the range [1, N] without rand() or truncating functions

50 Views Asked by At

I am working in a platform that does not support more advanced math functions such as trig functions, modulus, ceiling, floor or rand(). I have access to [+, -, *, /]. Is it possible to create an expression that can find a "random" integer from 1 to N starting from a seed integer value (such as time in seconds). The value does not technically need to be random but non-repeating and non-sequential.

From what experimenting and searching I have done I don't expect that an elegant solution exists and that this approach for "random" selection should be abandoned. Maybe some clever thinkers here have some ideas for this problem?