Let $\gcd(x_1,n)=d_1, \gcd(x_2,n)=d_2$ where $1\le x_1,x_2\le n-1$, $n$ is a given positive fixed integer. Find $\gcd(x_1,x_2)$.
I am stuck at finding the $\gcd(x_1,x_2)$. My try
Let $\gcd(x_1,x_2)=d$. Then $d\mid x_1,d\mid x_2$. So $x_1=ad_1,x_2=bd_2$.
But I am stuck at how to use the facts $\gcd(x_1,n)=d_1, \gcd(x_2,n)=d_2$. If someone could kindly help me out, I will be grateful.