My attempt at a coprime dyadic verb, which returns 1 for coprime integers and 0
otherwise seems to not work. I do not understand why this verb fails.
coprime =. =&0@:+/@:(e.&q:)
5 coprime 6
returns 0.
My understanding is thus:
Verb is read right to left.First :
5 (e.&q:) 6
is evaluated. This equates to (q: 5) e. (q: 6). (which gives 0)
Next +/ acts monadically on this result.
Finally we compare the result with 0.
So my understanding is 5 coprime 6 should return 1.
Regards.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm