def solve(): """Solve the problem and return the result""" result = 1 map = dict() for x in range(2, 20): temp = prime_factors(x) for n in range(2, 20): if n in temp: if n in map: map[n] = max(temp.count(n), map[n]) else: map[n] = temp.count(n) for x in map: result *= (x ** map[x]) return result
def solve(): """Solve the problem and return the result""" result = 1 map = dict() for x in range(2, 20): temp = prime_factors(x) for n in range(2, 20): if n in temp: if n in map: map[n] = max(temp.count(n), map[n]) else: map[n] = temp.count(n) for x in map: result *= (x**map[x]) return result
from common.prime import prime_factors if __name__ == "__main__": x = 600851475143 answer = max(prime_factors(600851475143)) print("Answer:", answer)
def factors(x): return __power_product(prime_factors(x))
def solve(): """Solve the problem and return the result""" num = prime.prime_factors(600851475143) return num[-1]