## Fix Python – What is the best way to get all the divisors of a number?

Here’s the very dumb way:

def divisorGenerator(n):

for i in xrange(1,n/2+1):

if n%i == 0: yield i

yield n

The result I’d like to get is similar to this one, but I’d like a smarter algorithm (this one it’s too much slow and dumb ðŸ™‚

I can find prime factors and their multiplicity fast enough.

I’ve an generator that generates facto….