Welcome to the forum!

You are not completely on the wrong track. When you say

it is important to mention that . But if then (Prove this! Hint : write and as products of prime powers. Then what does it mean for them to be relatively prime?)

So .

Setting you have and , so .