Let's say I want to find x such that x leaves remainder 2 when divided by 3 and x leaves remainder 3 when divided by 5.
x % 3 = 2
x % 5 = 3
We break down the problem to:
x % 3 = 1
x % 5 = 0
Therefore,
5k % 3 = 1
2k % 3 = 1
k = 2
10, when remainder = 1
20, when remainder = 2
Now x % 3 = 0
and x % 5 = 1
3k % 5 = 1
k = 2
6, when remainder = 1
18, when remainder = 3
Therefore, final solution is 20 + 18 = 38.
38 is a solution
LCM of 3,5 = 15.
38 - 15 - 15 = 8.
8 is the least number, that is the solution.
But now if I have
x % 7 = 3
x % 4 = 2
How do I solve the question ?