Example #1
0
def is_deficient_prefect_abundant(a):
    """Returns:
    -1 if number is deficient
    0 if it's proper
    1 if it's abundant"""
    f = proper_factors(a)
    d = sum(f) - a
    if d  > 0:
        return 1
    if d < 0:
        return -1
    return d
Example #2
0
def fact(n):
    try:
        return d[n]
    except KeyError:
        d[n] = proper_factors(n)
        return d[n]