Created
January 22, 2019 04:19
-
-
Save YannickLeRoux/26fa24f4aa3880872548d2a2a5cb34be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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