I need to select n elements from a list, which satisfy a condition. I need something like
Take[Select[r, (Length[FactorInteger[#]] > 100)&], 500]
but r might be something like Range[10^10], and I don't want Select to range over 10^10 elements when I need only first 500.
Caseshas a number restriction:Cases[r, x_ /; Length[FactorInteger[x]] > 100, 1, 500]. But remember that if the length ofSelect[r, ...]is a problem, then surely the length ofritself must be an even bigger problem, right? – Marius Ladegård Meyer Aug 11 '17 at 10:54Select[Range[500],#<600&,200]===Range[200]$\mapsto$True. Perhaps you're asking for a way to pass a lazy-evaluating list to a select type operation? – John Joseph M. Carrasco Aug 11 '17 at 11:14