# Get LCG from output?

Given a standard LCG output, let's say 3 consecutive numbers, I'm wondering how I could get $a$ and $c$ if I already know $m$

LCG formula:

Sn+1 = ( aSn + c ) mod m

I've seen this posted in a lot of places but no one is really giving a math explanation I could understand.

• This is addressed to some degree in this more general other question, and its answers. The present question focuses on case 2, I believe.
– fgrieu
Jan 27 '17 at 18:31