All pastes #623715 Raw Edit

Mine

public python v1 · immutable
·published 2007-07-17 20:04 UTC
rendered paste body
#!/usr/bin/pythonimport sysfrom math import sqrtfrom unique import uniquedef factorize(n):    def isPrime(n):        return not [x for x in xrange(2,int(sqrt(n))+1) if n%x == 0]    primes = []    candidates = xrange(2,n+1)    candidate = 2    while not primes and candidate in candidates:        if n%candidate == 0 and isPrime(candidate):            primes = primes + [candidate] + factorize(n/candidate)        candidate += 1    return primesdef divisors(n):        divisors = 1        factors = factorize(n)        candidates = unique(factors)        for candidate in candidates:                divisors = divisors * (factors.count(candidate)+1)        return divisorsdef t(n):        return ((n*(n+1))/2) i = 2while divisors(t(i)) < 500:        i = i + 1print t(i)