Luca Bruderer wrote: > I'm wondering which is the best algorithm to do this. And besides the other answers, if you are on Unix and want to use 'small' numbers, there's "factor" % factor 2343245345324523453 2343245345324523453: 3 11 53 59 463 49045023941 % Andrew