Suppose I knew that a random number sequence was generated by a linear congruential generator. That is,
$x_{n+1}=(aX_n+c) \bmod m$
If I am given the entire period (or at least a large contiguous subsequence of it), how can I reconstruct the parameters $a,c,m$ and $x_0$ that produced this sequence? I'm looking for a general method that will be able to determine the initial parameters if the pseudo-random number generator is known.