Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

random

Name: Anonymous 2012-01-01 23:19

hey /prog/.

is there a random number generator algorithm/library that supports something like this: use this seed, give me next nth random number? obviously it shouldn't iterate n times. I don't care if it is not that random.

there is probably something very simple for this but I can't get my head around it.

Name: Anonymous 2012-01-02 0:40

There's an LCG variant with that property: https://en.wikipedia.org/wiki/Lehmer_RNG

I haven't checked my math, but I think you want: Xk+i = g(i+1)·Xk mod n

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List