Skip to content

Instantly share code, notes, and snippets.



Created Jul 11, 2013
What would you like to do?
Factorization snippet
def factors(n):
return set(reduce(list.__add__,
([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment