find all multiplicands and multipliers for a number

Paul Rubin at nospam.invalid
Mon Apr 13 03:56:27 CEST 2015

Marko Rauhamaa <marko at> 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