def factor(num): factor = [1] for i in range(2,num+1): if num%i==0: factor.append(i) return sum(factor)