The difference between the HCF and LCM of $x$ and $18$ is $120$. Find $x$.
What I Tried: Let $\gcd(x , 18) = y$ and lcm$(x , 18) = z$ . Also, $z \geq y$ . We have :- $$\rightarrow 18x = yz$$ And :- $$\rightarrow z - y = 120$$ $$\rightarrow\frac{18x}{y} - y = 120$$ $$\rightarrow 18x - 120y - 120 = y^2$$ From here, we get that $6 | y^2$ $\rightarrow 6 | y$ .
After doing this, I am stuck. I do get this information but I am not able to use it somehow for $x$ , I could show that $x = 6k$ , but what to do next?
Can anyone help me? Thanks.
Since $y\le 18,y=6,12,18$. Reject $12$ since it is not a factor of $18$.
We get corresponding $z=120+y=126,138$. Reject $138$ since it is not a multiple of $18$.
We are left with $y=6,z=126,x=yz/18=42$.