Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def factor(x):
- divisors = []
- p = 2
- while p * p <= x:
- while x % p == 0:
- divisors.append(p)
- x //= p
- p += 1
- if x > 1:
- divisors.append(x)
- return divisors
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement