Understanding GCD and LCM