I am trying to find a sufficient condition so that
$$\frac{a_1 \cdots a_n}{gcd(a_1,\ldots,a_n)} = lcm(a_1,\ldots,a_n)$$
holds.
My idea would be to require that $gcd(a_1,\ldots,a_n) = 1$, i.e. the $a_i$ are pairwise coprime, which is clearly a necessary condition.
However, I am having trouble proving that $gcd(a_1,\ldots,a_n) = 1$ is indeed also sufficient. I tried to start by assuming that
$$\frac{a_1 \cdots a_n}{gcd(a_1,\ldots,a_n)} = lcm(a_1,\ldots,a_n)$$
holds, but I do not see how I can conlcude from there that $gcd(a_1,\ldots,a_n) = 1$. Could you give me a hint?