What is the logic of this process
问题 I was working on a problem in Project Euler; and I found a question in SO. The question and accepted answer says; n = 600851475143 i = 2 while i * i < n: while n%i == 0: n = n / i i = i + 1 print (n) It's just awesome. I still can't understand how this process is so fast and can find the largest prime factor of 600billion in 0.00001 seconds. I tried tons of methods and codes for that, processes took over than 1 hour.. Could anyone explain me the logic of this codes and why it's super-fast? is