def main():
    numbers = list()  # amicable numbers
    for i in xrange(1, 10001):
        sum_prodiv = sum_proper_divisors(i)  # sum of proper divisors
        if sum_proper_divisors(sum_prodiv) == i and sum_prodiv != i:
            numbers.append(i)

    print sum(numbers)
def calc_period_old(num):
    """Return the period of amicable chain
    >>>calc_period(5)
    >>>0
    Todo: deficient number, abundant number"""
    if isprime(num):
        return 0
    chain = list()
    chain.append(num)
    while True:
        sum_prodiv = sum_proper_divisors(num) # sum of proper divisors
        if sum_prodiv not in chain:
            chain.append(sum_prodiv)
            num = sum_prodiv
        else:
            break
    return len(chain)
def create_sociable_numbers(num):
    """There are some bags in this function.
    >>>create_sociable_numbers(5)
    >>>[]"""
    if isprime(num):
        return list()
    chain = list()
    chain.append(num)
    while True:
        if isprime(num):
            return list()
        sum_prodiv = sum_proper_divisors(num) # sum of proper divisors
        if sum_prodiv not in chain:
            chain.append(sum_prodiv)
            #num = sum_prodiv
        else:
            break
        num = sum_prodiv
        if is_perfect(num):
            return list()
    return chain