1
$\begingroup$

This question already has an answer here:

If I enter LCM[1,2,3,4,5] 60 is returned. if I enter LCM[Range[5]] {1,2,3,4,5} is returned.

I think I understand why it returns a list. (because it is treating the list as one argument?)

How can I use the output from the Range function act as individual arguments in the LCM function? How do I change LCM[Range[5]] so that it too returns 60?

$\endgroup$

marked as duplicate by Kuba list-manipulation Feb 12 at 19:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

Use Apply, or its short form @@:

LCM @@ Range[5]
(* 60 *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.