arbitrary length input



try

lcd([n]):=

then refer to length(n),  n[1], n[2], etc.

So you could do if length(n)=1 then n[1] else lcd(n[1],apply(lcd,rest(n));

or some such thing.

RJF
 

-----Original Message-----
From: maxima-admin at math.utexas.edu [mailto:maxima-admin at math.utexas.edu] On
Behalf Of Fabrizio Caruso
Sent: Wednesday, July 26, 2006 9:50 AM
To: maxima at math.utexas.edu
Subject: arbitrary length input

Hi,

how can I define a function, say lcm,
with an input of arbitrary length, e.g.:
lcd(2,3), lcm(4,5,6,6)?

   Thanx in advance

  Fabrizio Caruso


  

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima