find all multiplicands and multipliers for a number
Paul Rubin
no.email at nospam.invalid
Sun Apr 12 21:56:27 EDT 2015
Marko Rauhamaa <marko at pacujo.net> writes:
> And in fact, the sqrt optimization now makes the original version 20%
> faster: ...
> bound = int(math.sqrt(n))
That could conceivably fail because of floating point roundoff or
overflow, e.g. fac(3**1000). A fancier approach to finding the integer
square root might be worthwhile though.
More information about the Python-list
mailing list