No, but how hard can it be when lcm(a,b,c) == lcm(lcm(a,b),c) and lcm(a,b) == 
a*b/gcd(a,b)?

There are at least two good a recursive gcd algorithms, one that requires *at most* 5 
lines of Java.  They other uses left and right shift operators (recently discussed 
here) to good advantage.  Check google with the keys "gcd" and "algorithm".

-- Roger

> -----Original Message-----
> From: Sistem Analisti [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 05, 2002 8:56 AM
> To: JDJList
> Subject: [jdjlist] lcm of the int elements of an array
> 
> 
> 
> Is there a method in Java to find the least common
> multiple of the integer elements of an array directly?
>  
> 
> __________________________________________________
> Do you Yahoo!?
> Faith Hill - Exclusive Performances, Videos & More
> http://faith.yahoo.com
> 
> ____________________________________________________
> To change your JDJList options, please visit:
> http://www.sys-con.com/java/list.cfm
> 
> Be respectful! Clean up your posts before replying
> ____________________________________________________


____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm

Be respectful! Clean up your posts before replying
____________________________________________________

Reply via email to