Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def factorize(n):
- factors = []
- while n % 2 == 0:
- factors.append(2)
- n = int(n/2)
- for b in range(3, int(n**0.5) + 1, 2):
- while n % b == 0:
- n = int(n/b)
- factors.append(b)
- if n > 2:
- factors.append(int(n))
- product = 1
- for c in set(factors):
- product *= c
- return product
- nums, facprods = [1], [1]
- for x in range(2, 10**5+1):
- print(x)
- nums.append(x)
- facprods.append(factorize(x))
- print(sorted(list(zip(facprods, nums)))[9999][1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement