Hint $\rm\,\ p\nmid a\:$ $\Rightarrow$ $\rm\:(ap^j,bp^{k+j})\,=\, (a,bp^k)\,p^j =\, (a,b)\,p^j\ $ by Euclid's Lemma. Recurse on $\rm\,(a,b).$
Alternatively, employ the universal definition: $\rm\,\ gcd(\color{#0A0}{a,b}) = \color{#C00}d \ \ $ iff $\rm\ \ c\mid \color{#0A0}{a,b}\!\iff\! c\mid \color{#C00}d$
Notice, by unique factorization, $\rm\ \prod P_i^{J_i}\mid \prod P_i^{K_i}\iff J_i \le K_i.\:$ Therefore
$\rm \prod P_i^{J_i}\,\big|\, \color{#0A0}{\prod P_i^{K_i},\: \prod P_i^{L_i}} \iff J_i \le K_i,L_i \iff J_i\le min(K_i,L_i)\iff \prod P_i^{J_i}\,\big|\,\color{#C00}{\prod P_i^{min(K_i,L_i)}}$
Therefore, by the stated universal definition: $\rm\ gcd\left(\color{#0A0}{\prod P_i^{K_i},\: \prod P_i^{L_i}}\right) =\, \color{#C00}{\prod P_i^{min(K_i,L_i)}}$
Finally note that $\rm\ \prod P_i^{J_i}\:$ square $\,\Rightarrow$ $\rm \prod P_i^{J_i} = \left(\prod P_i^{K_i}\right)^2 = \prod P_i^{2 K_i}\: $ $\Rightarrow$ $\rm\:J_i\:$ even $ $ (and conversely), by unique factorization. Therefore $\rm\:J_i,K_i\:$ even $\,\Rightarrow$ $\rm\:min(J_i,K_i)\:$ even $\,\Rightarrow$ $\rm\:\prod P_i^{min(K_i,L_i)}\:$ square.