Talk:Proper divisors: Difference between revisions

Content added Content deleted
No edit summary
Line 26: Line 26:


I believe you when you say the second version is faster than the first, but note (n + 1) // 2 + 1 can be replaced by floor(sqrt(n)) in the first version. 141 rather than 10,000 in the case of 20,000. This would be a fairer comparison!--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:32, 19 December 2014 (UTC)
I believe you when you say the second version is faster than the first, but note (n + 1) // 2 + 1 can be replaced by floor(sqrt(n)) in the first version. 141 rather than 10,000 in the case of 20,000. This would be a fairer comparison!--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:32, 19 December 2014 (UTC)

You may wish to look at the fourth example [[Factors_of_an_integer#Python]] for an efficient method of finding the factors of a large number of contiguos integers--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 15:57, 19 December 2014 (UTC)