+0  
 
0
83
1
avatar

Find the least positive multiple of 7 which leaves a remainder of 4 when divided by any of 6, 9, 15 and 18.

 Jul 6, 2020
 #1
avatar
0

a=0;b=0;c=0;d=0;e=0;p=0; cycle:n= a*10000+b*1000+c*100+d*10+e;if(n%7==0 and n%6==4 and n%9==4 and n%15==4 and n%18==4, goto loop, goto next); loop:printn,", ",;p=p+1; next:e++;if(e<10, goto cycle, 0);e=0;d++;if(d<10, goto cycle, 0);e=0;d=0;c++;if(c<10, goto cycle,0);c=0;d=0;e=0;b++;if(b<10, goto cycle,0);e=0;d=0;c=0;b=0;a++;if(a<10, goto cycle,0);print"Total = ",p

 

OUTPUT = 364 - This is the smallest multiple of 7 that leaves a remainder of 4 when divided by 6, 9, 15 and 18.

 Jul 6, 2020

10 Online Users

avatar