# a and b are integers where gcd(a,b)=p which is a prime. find gcd(a^2,b^2).

Problem 5 (10 points): Let $a,b$ be integers such that $g.c.d.(a,b) = p$ where $p$ is prime. Find $g.c.d.(a^2,b^2)$.

(Original screenshot)

I've found that $g.c.d. (a^2,b^2) = p^2$ when using examples for $(a,b)$ like $(9,12)$, $(34,85)$, and $(14,21)$ whose gcd's are primes. I could put my answer down as $g.c.d. (a^2,b^2) = p^2$ and probably get the answer right but I would really like to find that through proofs rather than examples. Any help is appreciated.

-
By squaring a and b, you do not introduce any additional prime factors. – Tpofofn Feb 9 '14 at 3:33

More generally, let $(a,b)=p$ where $p$ is a positive integer and $\displaystyle \frac aA=\frac bB=p\implies (A,B)=1$
So, $\displaystyle(a^n,b^n)=(p^nA^n,p^nB^n)=p^n(A^n,B^n)$
As $A,B$ are coprime, so will be $A^n,B^n$
$\displaystyle\implies(a^n,b^n)=(a,b)^n$
What does $A,B$ and $A^n, B^n$ being coprime have to do with the assumption $(a^n,b^n)=(a,b)^n$? I understand everything else. – magnuspaajarvi Feb 9 '14 at 4:07
@magnuspaajarvi, We have $$(a^n,b^n)=p^n(A^n,B^n)=p^n=(a,b)^n$$ – lab bhattacharjee Feb 9 '14 at 4:17