Quote:
Originally Posted by roadside_cafe
but what if A-p is not = B-q is not = C-r
wghat wd we do in that case? plus the part highlighted in bold.. i am not able to understand how we get that? as in how A-p=B-q=C-r = some k leads to Then the number becomes Lcm(A,B,C,D) - k.
i'll explain,
when 'n' is divided by A it leaves remainder a
so n=kA+a
similarly, n=lB+b and n=mC+c (k,l,m are some constants)
so how does n= LCM(A,B,C) - A-a or B-b or C-c (ie if these three values are equal)
thanks a lot for ur help and the answer that u've got is spot on!! no calc mistakes
|
See, What u have written is right, when 'n' is divided by A it leaves remainder a
so n=kA+a
similarly, n=lB+b and n=mC+c (k,l,m are some constants)
Assuming all these conditions are parallely true and consider that a,b,c (all remainders) are equal - then LCM (A,B,C) + r (=a or b or c)
This is best understood by an example - consider 31 ,
when divided by 2 leaves 1, when divided by 3 leaves 1, when by 5 leaves 1.
All these cases, remainder is the same - right = 1?
So to back track (to get 31)
We need to take LCM(2.3.5.) = 30 And add the remainder to it. ie. 1.
31 + 30k = N
In the present case, 5 leaves 1, 6 leaves 2,7 leaves 3, 8 leaves 4 etc, a funda of negative remainders is used.
eg 11 mod 2 = 1 (this remainder can also be written as -1)
like 13 mod 5 = 3 ( also = -2)
30 mod 7 = 2 (also -5)
as the remaiinders and 1,2,3,4 for 5.6.7.8
we can also say that reaminders are = -4,-4,-4,-4 for each of these 5 divisors.
and then, used the above funda
LCM(4,5,67) + remiander (which is -4)
= LCM(4,5,6,7) -4.
------I think if there is some confusion, there is thread on number system , in quant practice, try doing some questions there, and the doubts will get cleared.
Al the best.