Enumerate factors of a number directly in ascending order without sorting?

This answer gives a C implementation that I believe is the fastest and most memory-efficient. Overview of algorithm. This algorithm is based on the bottom-up merge approach introduced by Will Ness in another answer, but is further simplified so that the lists being merged do not actually ever exist anywhere in memory. The head element … Read more