Exemplo n.º 1
0
def main ():
    abundantLimit = 28123
    primes = []
    abundants = [12]

    splittableSum = 0
    for n in xrange(13, abundantLimit+1):
        if is_abundant(n, primes):
            abundants.append(n)

        if is_abundant_splittable(n, primes, abundants):
            splittableSum += n

    totalSum = partial_sum(abundantLimit)
    print "splittableSum: %d, total sum: %d" % (splittableSum, totalSum)

    return totalSum - splittableSum
Exemplo n.º 2
0
 def test_abundant(self):
     self.assertTrue(numutils.is_abundant(12))