Re: Lowest Common Multiple programming
- To: mathgroup at smc.vnet.net
- Subject: [mg85625] Re: Lowest Common Multiple programming
- From: Szabolcs <szhorvat at gmail.com>
- Date: Sat, 16 Feb 2008 03:26:25 -0500 (EST)
- References: <fouejc$mah$1@smc.vnet.net>
On Feb 13, 10:51 am, "Lea Rebanks" <lreba... at netvigator.com> wrote:
> Hi All,
>
> I am trying to make a programming code to find the LCM between the following
> numbers.
> I DO NOT want to use Prime Factorization but wish to setup some kind of
> table multiplication process until required results are found.
>
> Here are the correct results shown using LCM function
>
> LCM[Rationalize[1.4137, 0],
> Rationalize[2.5, 0], 5,
> Rationalize[12.5, 0]]
> 353425
> N[%/{Rationalize[1.4137, 0],
> Rationalize[2.5, 0], 5,
> Rationalize[12.5, 0]}]
> {250000., 141370., 70685., 28274.}
>
> Any help & advice gratefully received.
> Many thanks for your help & attention.
If you mean that you'd like to implement an LCM algorithm yourself,
compute the GCD first with the Euclidean algorithm (look it up), and
use the result to find the LCM.