This comes up fairly often in code golf, and I'm looking for the canonical technique in J.
You have a filter verb (ie, a boolean returning verb) that operates on the natural numbers. You wish to find the nth number for which this verb returns true.
To be clear, we are considering the infinite list of all positive integers, and f is a black box verb.
Using Do...While ^:^:_ is awkward because you need to both increment the "current number" as well as conditionally update the number of "true" results thus far, which means your y-arg is a list that must be broken apart with {. and {: on each iteration.
Recursive solutions $: are open to the same criticism.
Is there a better approach to these kinds of problems?