# Thread: Prime GCD

1. ## Prime GCD

Suppose that $\displaystyle gcd(m,n)=p$, p prime, find $\displaystyle gcd(m^2,n^2)$.

I'm guessing that $\displaystyle p^2$ is the answer to this thing, and surely it divides both $\displaystyle m^2$ and $\displaystyle n^2$. But I'm having trouble afterward, thanks!

2. You can first look at prime divisors. If $\displaystyle q$ is a prime number dividing both $\displaystyle m^2$ and $\displaystyle n^2$, then $\displaystyle q$ divides both $\displaystyle m$ and $\displaystyle n$ (because of primality), hence $\displaystyle q$ divides $\displaystyle p$ and $\displaystyle q=p$ (again because of primality of $\displaystyle p$).

So $\displaystyle \gcd(m^2,n^2)$ is a power of $\displaystyle p$. It is at least $\displaystyle p^2$, as you said, so it suffices to rule out the case $\displaystyle \gcd(m^2,n^2)=p^3$. However, in the prime decomposition of $\displaystyle m^2$, the exponents are even (twice what they are for $\displaystyle m$), so that $\displaystyle p^3|m^2$ implies $\displaystyle p^2|m$ (you could also simply say that $\displaystyle p|\left({m\over p}\right)^2$ and $\displaystyle p$ is prime, so that $\displaystyle p|{m\over p}$, which means $\displaystyle p^2|m$). And the same holds with $\displaystyle n$, whereas $\displaystyle p^2$ does not divide both $\displaystyle m$ and $\displaystyle n$ (it is greater than their gcd). This concludes that $\displaystyle p^3$ can't be the gcd, hence it is $\displaystyle p^2$.

Laurent.