Example #1
0
def sum_proper_divisors(num):
''' Returns the sum of the proper divisors '''
    factors = list(prime_factors(num,prime_list))
    total = 0
    primes = map(lambda x: x[0] , factors)
    expons = map(lambda x: x[1] , factors)
    for expon_list in  product( *map(lambda x: range(x+1), expons) ):
        if list(expon_list) != expons:
            total += reduce( mul ,map( lambda x, y : x**y , primes, expon_list), 1)
    return total
Example #2
0
def is_abundant(x):
    if x in prime_set:
        return False
    factors = list(prime_factors(x, prime_list))
    primes = map(lambda x: x[0], factors)
    expons = map(lambda x: x[1], factors)
    sum = 0
    for p in product(*map(lambda x: range(x + 1), expons)):
        if expons != list(p):
            sum += reduce(mul, map(lambda x, y: x ** y, primes, p), 1)
    return sum > x
Example #3
0
def is_abundant(x):
    if x in prime_set:
        return False
    factors = list(prime_factors(x, prime_list))
    primes = map(lambda x: x[0], factors)
    expons = map(lambda x: x[1], factors)
    sum = 0
    for p in product(*map(lambda x: range(x + 1), expons)):
        if expons != list(p):
            sum += reduce(mul, map(lambda x, y: x**y, primes, p), 1)
    return sum > x
Example #4
0
def test_4(num):
    if len(prime_factors(num)) > 3:
        return True
    return False
Example #5
0
def main():
    return max(prime_factors(600851475143))
Example #6
0
from eulertools import prime_factors

print(max(prime_factors(600851475143)))
Example #7
0
def test_4(num):
    if len(prime_factors(num)) > 3:
        return True
    return False