mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-28 06:13:43 +03:00
28 lines
502 B
Python
28 lines
502 B
Python
|
import math
|
||
|
|
||
|
|
||
|
def divisors(n):
|
||
|
divs = [1]
|
||
|
for i in range(2, int(math.sqrt(n)) + 1):
|
||
|
if n % i == 0:
|
||
|
divs.extend([i, n // i])
|
||
|
divs.extend([n])
|
||
|
return list(set(divs))
|
||
|
|
||
|
|
||
|
def is_d(n):
|
||
|
d = divisors(n)
|
||
|
d.remove(1)
|
||
|
d.remove(n)
|
||
|
return sum(d) > 460000
|
||
|
|
||
|
|
||
|
for i in range(135790, 163228 + 1):
|
||
|
if is_d(i):
|
||
|
print(i)
|
||
|
d = divisors(i)
|
||
|
d.remove(1)
|
||
|
d.remove(i)
|
||
|
print(len(d), sum(d))
|
||
|
print()
|