What are the possible values for $\gcd(a^2, b)$ if $\gcd(a, b) = 3$? I was looking back at my notes on number theory and I came across this question.
Let $a$, $b$ be positive integers such that $\gcd(a, b) = 3$. What are the possible values for $\gcd(a^2, b)$?
I know it has to do with their prime factorization decomposition, but where do I go from here?

Hint $\rm\: \ (a,b)\ |\ (a^2,b)\ |\ (a,b)^2\ $ since $\rm\ (a^2,b)\ |\ a^2,ab,b^2\ \Rightarrow\ (a^2,b)\ |\ (a^2,ab,b^2) = (a,b)^2 $
Therefore $\rm\:3\ |\ (a^2,b)\ |\ 9\:$ when $\rm\:(a,b) = 3\ \ $ QED
Or: $\:$ let $\rm\:a = 3^K A,\:\ b = 3^N B,\ \ 3\nmid A,B.\ \ $ $\rm(a,b)=3\ \Rightarrow \ (A,B) = 1\:$ and $\rm\:\min(K,N) = 1.\:$ Thus
$$\rm (a^2,b) = (3^{2K} A^2, 3^N B) = (3^{2K},3^N)(A^2,B) = (3^{2K},3^N) = 3\: \ if\: \ N\! =\! 1\:  \ else \ 9\ ( N \ge 2\Rightarrow K = 1)$$
