Re: Re: LCM With Variable Number of Arguments
- To: mathgroup at smc.vnet.net
- Subject: [mg43336] Re: [mg43301] Re: LCM With Variable Number of Arguments
- From: Dr Bob <drbob at bigfoot.com>
- Date: Mon, 25 Aug 2003 04:10:47 -0400 (EDT)
- References: <bi7nme$p9k$1@smc.vnet.net> <200308240854.EAA12525@smc.vnet.net>
- Reply-to: drbob at bigfoot.com
- Sender: owner-wri-mathgroup at wolfram.com
LCM@@myList
Bobby
On Sun, 24 Aug 2003 04:54:58 -0400 (EDT), Steven Shippee
<slshippee at comcast.net> wrote:
> Regarding LCM (Least Common Multiple) - it works on various elements, but
> they must be in brackets, not parenthesis.
>
> For example, you wanted to act on myList = { 2, 3, 4, 5 }
>
> if you change this to LCM[2, 3, 4, 5 ]
> Mathematica will return the answer you expect, 60.
>
> Thanks in advance,
>
> Steven Shippee
> shippee at jcs.mil
> (360) 493-8353
>
>
> "Mark Lookabaugh" <mlookabaugh at NO_ADS.cox.net> wrote in message
> news:bi7nme$p9k$1 at smc.vnet.net...
>> Hi,
>>
>> I have a list of numbers, and I'd like to get the LCM of all the
>> values in the list. The list isn't always the same length at runtime.
>>
>> What's the syntax to specify that?
>>
>> For example:
>>
>> If I have myList = { 2, 3, 4, 5 }
>> I'd like to do something like LCM[myList] and get 60.
>>
>> but that actually returns { 2, 3, 4, 5 } (I guess performing LCM on
>> each element individually).
>>
>> How can I get LCM to act on a bunch of values at once?
>>
>> Thanks for any help,
>> Mark
>>
>> --
>> Mark Lookabaugh
>> mlookabaugh (at) cox.net
>> USS Brewton FF-1086 Home Page
>> http://www.ussbrewton.com
>>
>
>
--
majort at cox-internet.com
Bobby R. Treat
- References:
- Re: LCM With Variable Number of Arguments
- From: "Steven Shippee" <slshippee@comcast.net>
- Re: LCM With Variable Number of Arguments