Inspired from programming-algorithms.net/article... Takes less than 1sec to get to 137438691328 but can't find easily 2305843008139952128

from math import sqrt def perfect(n) : s = 1 rac = int(sqrt(n)) for k in range(2, rac+2) : if n%k == 0 : s += k + n//k return s == n def f(x) : return (2**(x-1))*((2**x)-1) n = 137438691329 m = 1 res = [] while True : val = f(m) print(val) if perfect(val) : res.append(val) m+=1 if val > n : break print(res)

site is great for algo, thanks.

We're a place where coders share, stay up-to-date and grow their careers.

We strive for transparency and don't collect excess data.

## re: Write a script to find "Perfect Numbers" VIEW POST

VIEW FULL DISCUSSIONInspired from programming-algorithms.net/article...

Takes less than 1sec to get to 137438691328 but can't find easily 2305843008139952128

site is great for algo, thanks.