The difference between the HCF and LCM of $x$ and $18$ is $120$. Find $x$.

divisibilitygcd-and-lcmnumber theoryproblem solving

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.

Best Answer

No casework needed.

$\gcd(x,18) + 120 = \text{lcm} (x,18) \implies \gcd(x,18) \equiv -120 \equiv 6 \pmod{18}$

Therefore $\gcd(x,18)=6, x = \gcd(x,18)\cdot \text{lcm}(x,18)/18 = 6 \cdot 126/18=42$.