def factor(n): p=defaultdict(int) r = n while r > 1: if not r % 2: c=2 else: c=3 while r % c > 0: c+=2 p[c]+=1 r /= c return sum([k**v for k,v in p.iteritems()]) print factor(100)