In this Kata, you will be given two numbers, `a` and `b`, and your task is to determine if the first number `a` is divisible by `all` the prime factors of the second number `b`. For example: `solve(15,12) = False` because `15` is not divisible by all the prime factors of `12` (which include`2`).

See test cases for more examples. 

Good luck!

If you like this Kata, please try:

[Sub-array division](https://www.codewars.com/kata/59eb64cba954273cd4000099)

[Divisor harmony](https://www.codewars.com/kata/59bf97cd4f98a8b1cd00007e)

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def solve(a,b):
	

Solutions:
import fractions

def solve(a, b):
	c = fractions.gcd(a, b)
	while c > 1:
		b //= c
		c = fractions.gcd(a, b)
	return b == 1


from math import gcd

def solve(a, b):
	while 1 < gcd(a, b):
		b = b // gcd(a, b)
	return b == 1


from math import gcd

def solve(a, b):
	x = gcd(a, b)
	if x == 1:
		return False
	if x == b:
		return True
	return solve(a, b // x)


from fractions import gcd

def solve(a, b):
	if b == 1:
		return True
	if gcd(a, b) == 1:
		return False
	return solve(a, b / gcd(a, b))


def solve(a, b):
	(li, j) = ([], 2)
	while b > 1:
		if b % j:
			j += 1
			continue
		li.append(j)
		b //= j
		if a % j:
			return 0
	return 1


def solve(a, b):
	k = 2
	while k <= int(b ** 0.5):
		while b % k == 0:
			b //= k
			if a % k != 0:
				return False
		k += 1
	return a % b == 0


def solve(a, b):
	b1 = b
	answer = True
	i = 2
	primfac = []
	while i * i <= b:
		while b1 % i == 0:
			primfac.append(i)
			b1 = b1 // i
		i = i + 1
	if b1 > 1:
		primfac.append(b1)
	for i in range(0, len(primfac)):
		if a % primfac[i] != 0:
			answer = False
	return answer


N = 10000
a = [1] * N
a[0] = a[1] = 0
for i in range(2, N):
	if a[i]:
		for j in range(i ** 2, N, i):
			a[j] = 0
a = [i for (i, x) in enumerate(a) if x]

def solve(n, m):
	return all((not n % x for x in f(m)))

def f(n):
	s = set()
	for x in a:
		if x > n:
			break
		while not n % x:
			n //= x
			s.add(x)
	if n > 1:
		s.add(n)
	return s


def solve(a, b):
	p = 2
	while True:
		if b == 1:
			return True
		if a % p > 0 and b % p == 0:
			return False
		while b % p == 0:
			b /= p
		p += 1


from math import ceil, sqrt

def factorize(x):
	factors = []
	for i in range(2, ceil(sqrt(x)) + 1):
		while x % i == 0:
			factors.append(i)
			x /= i
	if x != 1:
		factors.append(x)
	return factors

def solve(a, b):
	factors = factorize(b)
	ok = True
	for factor in factors:
		if a % factor != 0:
			ok = False
	return ok