Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import sqrt
- def list_squared(m, n):
- res = []
- for x in range(m, n+1):
- divisors = []
- for q in range(1, x+1):
- if x % q == 0:
- divisors.append(q**2)
- if sqrt(sum(divisors)) == int(sqrt(sum(divisors))):
- res.append([x, sum(divisors)])
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement