def dl(n):
d=1
l=[]
while d*d<=n:
if n%d==0:
l.append(d)
if d!=n//d:
l.append(n//d)
d+=1
return sorted(l)
def F(n):
for i in range(1, n+1):
l.append((sum(dl(i)), i))
return max(l, key=lambda x:x[0])[1]
print(F(100))
''96''
def dl(n):
d=1
l=[]
while d*d<=n:
if n%d==0:
l.append(d)
if d!=n//d:
l.append(n//d)
d+=1
return sorted(l)
def F(n):
l=[]
for i in range(1, n+1):
l.append((sum(dl(i)), i))
return max(l, key=lambda x:x[0])[1]
print(F(100))
print(F(100))
''96''