Hello Terrence;

This looks like you want

  a f b f c f d ...

except you want it to be left-associative.

if you had

  g =: f~

and you did

  ... d g c g b g a

which is right-associative, you'd be done

g/ ...d c b a NB. Dangit, I miss strand notation. but this is just an email

or

  f~/ |. vector

so

  process_prime~/ |. A,2,3,...,27

would work.

Hopefully this is clearer than Mr. Miller's sentence.

Terrence Brannon wrote:
Concretely, so you can play with things, I need to call

(((A process_prime 2) process_prime 3) process_prime 4) ... process_prime 27


multiples     =: 4 : 'y * (1 + ( i.(>. x % y)))'   NB. max multiples n
make_sieve    =: 3 : '0 (0 1) } (y+1) $ 1'
next_prime    =: prime_indices pick_prime ]
prime_indices =: I. @ [   NB. return indices in list which equal 1
pick_prime =: I. { [ NB. dyadic fork to lookup the drop_le =: 4 : '(x > y) # x' NB. drop elements in list <= value

NB. A process_prime 2 - marks all multiples of 2 in A as non-prime
process_prime =: 4 : '0 (}: }. (((#x)-1) multiples y)) } x'

A =: make_sieve 27

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


--
later ...
<pre>------------------------------------------------------------------------
|\/| Randy A MacDonald   | APL: If you can say it, it's done.. (ram)
|/\| [EMAIL PROTECTED]  |
|\ |                     | 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      | Looking for a whip-smart APL developer <a href="mailto:[EMAIL 
PROTECTED]">Send me a note</a>
-----------------------------------------------------(INTP)----{ gnat }-</pre>

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

Reply via email to