ユークリッドの互除法。
a,bに対してx,yが存在して
gcd(a,b)=ax+by。

2^gcd(a,b)=(2^a)^x(2^b)^y。