This question already has an answer here:

Pretty basic question here about the gcd algorithm: How can we prove that if gcd(m,n)=1=gcd(a,m) then gcd(an,m)=1?


marked as duplicate by Bill Dubuque elementary-number-theory Nov 7 '18 at 0:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Have you already proved that if a prime divides a product it divides one of the factors? If so you can use that fact here. $\endgroup$ – Ethan Bolker Nov 7 '18 at 0:09