I am reading a paper on random numbers generation on congruential method 785 = 308a + k (mod 1024) 930 = 785a + k (mod 1024) the solution is a=69 and k=13 Here is how I solve the problem. I multiply both side with 1024 such that the "mod" on the right side gone ,i.e. 785*1024 = 308a + k 930*1024 = 785a + k subtract one from another gives 477a = 148480 ===> a = 311.2788 but this is wrong. What is the right way to solve this kind of equations? Thanks.