Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from time import time
- st = time()
- goal = 1000
- n = goal
- solutions = 0
- while solutions <= goal:
- solutions = 0
- for x in range(n + 1, 2*n + 1):
- y, rem = divmod(x * n, x - n)
- if rem == 0:
- solutions += 1
- if n % 1000 == 0:
- print('n = {:5}, solutions: {:4}, time is {:6.3f}'.format(n, solutions, time() - st))
- n += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement