from functools import reduce
return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(sqrt(n)) +
    1, step) if n % i == 0)))
What is the most efficient way of finding all the factors of a number in Python?