Raul Miller wrote:

> Another approach would be:
>     [: +/ ] =&[EMAIL PROTECTED] i.
> or
>    +/@:=&1@(+. i.)

I'd be inclined to write this as

t3=:[; +/ 1=(+.i.)

The approach in the essay can also be written as

t4=:(<:@:{. */ .* {.^<:@:{:)@:(__&q:)

which makes the multiplicative structure more evident.  If you are
generating a large number of totients, this structure reduces the problem
to finding a single non-trivial factor of each number.

Best wishes,

John


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

Reply via email to