Amicaux

66 days ago by cakedev

def s(a): return sum(divisors(a)[:-1]) def amicaux(a, b): return s(a) == b and s(b) == a def prochains(a): while s(s(a)) != a: a += 1 return [a, s(a)] print(prochains(200)) print(prochains(10000)) print(prochains(1000000)) 
       
[220, 284]
[10744, 10856]
[1043096, 998104]
[220, 284]
[10744, 10856]
[1043096, 998104]