+0  
 
0
53
2
avatar

How many ordered pairs of positive integers(m,n) satisfy gcd(m,n)=2 and lcm(m,n)=108?

 Mar 25, 2020
edited by Guest  Mar 25, 2020
 #1
avatar
+1

a=1; b=1;c=lcm(a, b); d=gcd(a, b);if(c==108 and d==2, goto5, goto7);print"LCM of",a,"and", b,"=",c;print"GCD of",a,"and", b,"=",d; a++;if(a<200, goto2, 0);a=1;b++;if(b<200, goto2, discard=0;

 

OUTPUT:

LCM of 108 and 2 = 108
GCD of 108 and 2 = 2
LCM of 54 and 4 = 108
GCD of 54 and 4 = 2
LCM of 4 and 54 = 108
GCD of 4 and 54 = 2
LCM of 2 and 108 = 108
GCD of 2 and 108 = 2

 Mar 25, 2020
 #2
avatar+1970 
+1

That's amazing, Guest!

CalTheGreat  Mar 25, 2020

6 Online Users