+0  
 
0
462
3
avatar

Find the smallest number such that
(i) it leaves a remainder 2 when divided by 3 ;
(ii) it leaves a remainder 3 when divided by 5 ;
(iii) it leaves a remainder 5 when divided by 7 .

 Jun 2, 2020
 #1
avatar+36916 
+1

*** deleted ***    misunderstoood question(s)    D'Oh !  cheeky

 Jun 2, 2020
edited by ElectricPavlov  Jun 3, 2020
 #2
avatar+23246 
0

Try 68; this number will fit (i), (II), (III).

 Jun 2, 2020
 #3
avatar
0

Using Chinese Remainder Theorem plus Modular Multiplicative Inverse, you get:

 

i=0;j=0;m=0;t=0;a=(3,5,7);r= (2, 3, 5);c=lcm(a); d=c / a[i];n=d % a[i] ;loop1:m++; if(n*m % a[i] ==1, goto loop, goto loop1);loop:s=(c/a[i]*r[j]*m);i++;j++;t=t+s;m=0;if(i< count a, goto4,m=m);printc,"m + ",t % c;return

 

 

OUTPUT =105m  + 68, where 105 is the LCM of[3,5,7] and m =0, 1, 2, 3......etc.

 Jun 2, 2020

5 Online Users

avatar
avatar
avatar