I have a linear congruential generator, which works based on this equation: $X_i = (aX_{i-1}+b) \mod m$. I'm trying to compute next number, but everything I have is given output. So for example $\;a = 5, b = 7, m = 9, \text{ and } X_0 = 3$ give us $\;X_1 = 4, X_2 = 0, X_3 = 7, X_4 = 6, X_5 = 1\ldots$ What I need is to find $a$, $b$ and $m$. I wrote this as system of modular equations:
$$\begin{cases} 1=(6a+b)\mod m\\ 6=(7a+b)\mod m\\ 7= b \mod m\\ 0=(4a+b)\mod m \end{cases} $$ I think that I have to somehow use an (extended) euclidean algorithm, but I cannot figure, how I'm supposed to do that.
After messing with the expressions for a while. I think there is no nice way to find out what $m$ is. But $a$ and $b$ (mod m) can be found using simple manipulation of modular equations. (Given enough terms $X_0,X_1,...$, usually 3 terms should do.)
Also note that the $a$ and $b$ found in the equation is only mod m. In your example, $a={5,14,23,32,...}$ and $b={7,16,25,34,...}$