a=1; b=1; if(gcd(24 , b)==(a + 4) and lcm(24,b)==a*(a+4), goto loop, goto next);loop:printa, b;print gcd(24, b);print lcm(24,b);next: a++;if(a<1000, goto2, 0);a=1;b++;if(b<1000, goto2, discard=0;
OUTPUT:
x = 20 and GCD =20 +4 =24 and LCM =20*(20 + 4) = 480
The smallest possible value of 2nd number = 480, so that:
GCD[24, 480] == 24 and LCM[24, 480] ==480, which agrees with the value of x ==20.