the least number which when divided by x,y and
z leaves the remainders a,b,and c respectively
such that (x-a=y-b=z-c)
={LCM OF(x, y, z)-k
where
, k=x-a=y-b=z-c
Answers
Step-by-step explanation:
We want a solution to this set of equations in integers:
n≡dmodan≡dmoda
n≡emodbn≡emodb
n≡fmodcn≡fmodc
Let M=abcM=abc. Also, let the following variables be calculated with the extended euclidean algorithm:
ia≡(M/a)−1modaia≡(M/a)−1moda
ib≡(M/b)−1modbib≡(M/b)−1modb
ic≡(M/c)−1modcic≡(M/c)−1modc
Then we have that n≡d∗ia∗Ma+e∗ib∗Mb+f∗ic∗McmodMn≡d∗ia∗Ma+e∗ib∗Mb+f∗ic∗McmodM. The formula works for any amount of remainders, the extension is given in the link at the top.
When a, b, and c are not pairwise relatively prime, it gets a bit trickier. Separate each equation n≡xmodyn≡xmody into a set of equations, n≡xmodpkn≡xmodpk for each prime power pkpk that divides yy. If there are any repeated primes, first make sure that they do not contradict each other (ie, x = 0 mod 3 and x = 1 mod 9). If they do, there is no solution. If they don’t, get rid of all but the highest power. Finally just apply the algorithm on the remaining equations.
I HOPE IT HELPS TO YOU
PLZZ MARK MY ANSWER AS BRILLIANT