The stupid question is the question not asked  
PerlMonks 
Comment onby gods 
on Feb 11, 2000 at 00:06 UTC ( #3333=superdoc: print w/replies, xml )  Need Help?? 
The two approaches are not the same at all. Say there are N numbers and R prime factors. The merge methods use:
N*(1/p1 + 1/p2 + ... 1/pR)*(R1) comparison operations to process a list of size N. The filter method tests each number with a single gcd calculation, which is O(logN) and is independent of the total number of factors. So to produce a list of size N should be O(NlogN). Depending on the size and quantity of factors, one or the other will be better. I would expect the filter to be better when there are many small factors, and the merge to be better when there are few factors or the factors are large. In reply to Re^3: Challenge: Another Infinite Lazy List
by tall_man

