Skip to content

Instantly share code, notes, and snippets.

@YannickLeRoux
Created January 22, 2019 04:19
Show Gist options
  • Save YannickLeRoux/26fa24f4aa3880872548d2a2a5cb34be to your computer and use it in GitHub Desktop.
Save YannickLeRoux/26fa24f4aa3880872548d2a2a5cb34be to your computer and use it in GitHub Desktop.
def list_squared(m, n):
# your code
sqrtDivisors =[]
for num in range(m, n+1):
divisors = []
for i in range(1, num+1):
if num % i == 0:
divisors.append(i)
divSqrd = [ x*x for x in divisors]
sumSquare = sum(divSqrd)
sqrtSum = sumSquare**(1/2)
if sqrtSum.is_integer():
sqrtDivisors.append([num, sumSquare])
return sqrtDivisors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment