2

How to determine if a number $A$ is divisible by all the prime factors of $B$?

For example: $120,75$

$A=120=2^3\times3\times5$ and $B=75=3\times5^2$

Therefore yes, $A$ is divisible by the prime factors of $B$.

Gregory Grant
  • 14,874
  • Possible duplicate of http://math.stackexchange.com/questions/1275848/one-number-divisible-by-all-prime-factors-of-another/1275883. – HSN May 12 '15 at 09:25

3 Answers3

2

While $\gcd(A,B)>1$ replace $B$ with $B/\gcd(A,B)$. If you end up at something $>1$, $B$ has started with some unnused primes

0

If $A=k\times B(p)$ where $k$ is a prime such that $k$ does not divide $B$ and $B(p)$ is the product of all prime factors of $B$. The statement makes it clear that $A$ is divisible by all prime factors of $B$.

grg
  • 1,017
0

take prime factorization of $GCD(A,B)$. prime factors of $B$ must be subset of prime factors of $GCD(A,B)$.

miniparser
  • 1,197