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 .
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.