Hello Raul;

Your use of i.&.(p:inv) suggests you have a high J literacy. Good on you. I also thought that a sentence involving p: would solve the problem, perhaps even more clearly. The use of too little of the available technology does reduce the clarity.

Raul Miller wrote:
On Fri, Apr 4, 2008 at 12:05 PM, Dan Bron <[EMAIL PROTECTED]> wrote:
It's a monad whose input is a scalar integer.  What is its output?  What does 
the verb do?

It rather inefficiently finds prime numbers in the sequence up
through 1 plus its right argument.

The overall structure of your verb is ()@:().  The right parenthesis
constructs the sequence 2..n+1

The left parenthesis first computes a multiplication table based
on that sequence, then ravels it, and then finds which members
of that original sequence did not appear in that multiplication table.
Finally, you select elements from that original sequence which
did not appear.

I think that i.&.(p:inv)@+&2 would perform this same operation
more efficiently.


--
------------------------------------------------------------------------
|\/| Randy A MacDonald       | APL: If you can say it, it's done.. (ram)
|/\| ramacd <at> nbnet.nb.ca |
|\ |                         | The only real problem with APL is that
BSc(Math) UNBF'83            | it is "still ahead of its time."
Sapere Aude                  |     - Morten Kromberg
Natural Born APL'er          |
-----------------------------------------------------(INTP)----{ gnat }-


----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to