Skip to content

Instantly share code, notes, and snippets.

@s-ff
Last active March 1, 2018 02:54
Show Gist options
  • Save s-ff/ecee81a78b601602503101e97f580ae3 to your computer and use it in GitHub Desktop.
Save s-ff/ecee81a78b601602503101e97f580ae3 to your computer and use it in GitHub Desktop.
def SumSquareDivisisors(m, n):
from math import sqrt as sq
result = []
f = lambda x: x**2
for k in range(m, n+1):
L = [k]
for i in range(1, k//2 + 1):
if k % i == 0:
L.append(i)
M = list(map(f, L))
totalSum = sum(M)
if sq(totalSum) % 1:
result.append([k, totalSum])
return result
print(SumSquareDivisisors(1,250))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment