z = 2 while True: s = 1 t = 2 while t*t<=z: if z%t == 0: s+=t if t!=z/t: s+=z/t t+=1 if s==z: print("Perfekte Zahl %d" % z) z+=1 if (z%100000==0): print("[%d]" % z)