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?


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.


Use Apply, or its short form @@:

LCM @@ Range[5]
(* 60 *)

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