@Warren Hill: looking at your post it dawns on me that if there are N factors there are 2^N divisors to test (with likely many duplicates, but I don't care) and the binary form of the value iterated from 0 to 2^N-1makes it easy to compute the divisor... And if you take this value as path in a binary tree, and set the node value to the corresponding divisor, you can cut off everything beyond the nodes where the divisor is greater than the square root.
@trent.josephsen: yes, alas
@Bachstelze: everything is easier with the right library but yes, iterating the divisors is likely the best solution (see above)
@Vaphell: nice awk hack!
@spjackson: yes, this limits the number of divisors to check (or to compute)
Bookmarks