in reply to Re^2: Check randomly generated numbers have not been used before
in thread Check randomly generated numbers have not been used before

In Xn+1 = (a*Xn + c) (mod m): If the offset c is relatively prime with m, you will generate a maximal-length sequence. Since GotToBTru picked the first prime ≥ S/2, it will be maximal with length S, and will guarantee that's there are at most 2 numbers from each period (ie, Xn+1 may not have wrapped around S, but Xn+2 definitely will have).
  • Comment on Re^3: Check randomly generated numbers have not been used before