Anonymous user
Factors of an integer: Difference between revisions
→{{header|Python}}
Line 1,453:
Much better (realize that factors come in pairs, the smaller of which is no bigger than sqrt(n)):
<lang python>>>> from math import
>>> def factor(n):
factors = set()
|