Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
from common.prime import prime_factors

if __name__ == "__main__":
    x = 600851475143
    answer = max(prime_factors(600851475143))
    print("Answer:", answer)
Ejemplo n.º 4
0
def factors(x):
    return __power_product(prime_factors(x))
Ejemplo n.º 5
0
def solve():
    """Solve the problem and return the result"""
    num = prime.prime_factors(600851475143)
    return num[-1]