We have that $2^3$ appears as a factor of $\gcd(a,b)$ and $2^6$ appears as a factor of $\text{lcm}(a,b)$, so we need that exactly one of $a$ and $b$ has $2^3$ as a factor and the other has $2^6$ as a factor. Same thing is true for the other prime numbers that are factors of the GCD and LCM.