On Dec 14, 2007 8:42 AM, Don Guinn <[EMAIL PROTECTED]> wrote:
> It seems to me that another problem would be to find a general solution
> which runs quickly for very large numbers.

gcd=: *./@x:
gcd=: ([:x:>./)&.(_&q:) NB. fast version

F=:gcd@:>:@i.%((]+:@x:@[EMAIL PROTECTED]>:*.-:@[<])(-.]-.]&.(p:inv))@(1 
_1+2^2<[EMAIL PROTECTED]))

(hopefully this is short enough that it won't wrap.)

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

Reply via email to