Jun-05-2019, 02:06 PM
I think you forget, that for each call, the iterations are summed up.
This is interesting for big numbers.
If you check for example the number 179424673, the sum of total iterations is in the range of:
by dividing with already known primes.
Calling the same function very often, causes the problem.
This is interesting for big numbers.
If you check for example the number 179424673, the sum of total iterations is in the range of:
sum(int(math.sqrt(i)) + 1 for i in range(3, 179424673)) # one minute later....
Output:1602346003985
Of course you won't hit the maximum possible iterations, because some values are sorted outby dividing with already known primes.
Calling the same function very often, causes the problem.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!