Example #1
0
def get_amicable_pair(num):

    a = list(solutions.factors(num))
    a.remove(num)
    a = sum(a)
 
    b = list(solutions.factors(a))
    b.remove(a)
    b = sum(b)

    if b == num and a != b:
        return a, b
    return None
Example #2
0
def max_triangle_divisors(limit):
    """
    >>> max_triangle_divisors(500)
    76576500
    """
    triangle_number = triangle_number_generator()
    while True:
        value = triangle_number.next()
        factors = solutions.factors(value)
        if len(factors) - 1 >= limit:
            return value
Example #3
0
def is_abundant_number(num):
    factors = list(solutions.factors(num))
    factors.remove(num)
    return sum(factors) > num